Skip to docs content

scpm why

  • Usage: scpm why [FLAGS] <PACKAGE>
  • Aliases: w

Print reverse dependency chains explaining why a package is installed

Arguments

<PACKAGE>

Package name to search for (exact match against package names)

Flags

-D --dev

Only follow chains that start at a devDependency

-P --prod

Only follow chains that start at a production (or optional) dependency

--json

Output as JSON — an array of chain objects

--long

Append each node's .scpm/<dep_path> store path to the tree output

--parseable

Tab-separated output: one line per chain, importer\tdep_type\tname@ver\t...

Examples:

$ scpm why debug my-app@1.0.0 /home/user/project

dependencies: express 4.19.2 └── debug 2.6.9 body-parser 1.20.2 └── debug 2.6.9

Only follow chains starting at a devDependency

$ scpm why --dev typescript

Include each node's store path

$ scpm why --long debug

Tab-separated, one chain per line (pipe-friendly)

$ scpm why --parseable debug

JSON: an array of chain objects

$ scpm why --json debug