rush why
rush why <package> [flags]Shows every dependency chain that caused a package to be installed — useful for debugging unexpected packages, resolving version conflicts, or understanding your dependency tree.
| Flag | Default | Description |
|---|---|---|
--depth <n> | all | Max levels to trace back toward the root |
--verbose | false | Show detailed dependency chain information |
Examples
Section titled “Examples”Show all dependency paths to lodash:
rush why lodashShow why @types/node is installed:
rush why @types/nodeShow only immediate dependents (2 levels up):
rush why axios --depth 2Output
Section titled “Output” my-app (dependency) └── [email protected] (dependency) └── my-app (dependency)If a package is pulled in via multiple paths, each path is listed as a separate section.
Dependency type labels
Section titled “Dependency type labels”| Label | Meaning |
|---|---|
(dependency) | Listed in dependencies |
(dev) | Listed in devDependencies |
(optional) | Listed in optionalDependencies |
peer badge | Listed in peerDependencies |
[deduped] | Already counted in another path |