LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

npm-why

shows why a package is installed

TLDR

Explain why a package is installed
$ npm why [package-name]
copy
Explain a specific version
$ npm why [package-name]@[version]
copy
JSON output
$ npm why [package-name] --json
copy
Limit depth of the dependency tree
$ npm why [package-name] --long
copy
Target a specific workspace
$ npm why [package-name] --workspace=[workspace-name]
copy

SYNOPSIS

npm why package-spec...

DESCRIPTION

npm why shows why a package is installed. Alias for npm explain.The command traces dependency paths. Shows all routes to package.

PARAMETERS

PACKAGE-SPEC

Package name, optionally with version range (e.g., lodash@^4).
--json
Output results in JSON format.
--long
Show extended information.
--workspace NAME
Limit to a named workspace or path.
--include-workspace-root
Include root project in addition to workspaces.
--help
Display help information.

INSTALL

sudo pacman -S npm
copy
sudo apk add npm
copy
brew install npm
copy

CAVEATS

Alias for npm explain. Shows all dependency paths. Requires installed package.

HISTORY

npm why provides dependency tracing to understand package relationships.

SEE ALSO

npm(1), npm-explain(1), npm-ls(1)

Copied to clipboard
Kai