Skip to main content
Version: 7.x

pnpm why

Shows all packages that depend on the specified package.

Optionsโ€‹

--recursive, -rโ€‹

Show the dependency tree for the specified package on every package in subdirectories or on every workspace package when executed inside a workspace.

--jsonโ€‹

Show information in JSON format.

--longโ€‹

Show verbose output.

--parseableโ€‹

Show parseable output instead of tree view.

--global, -gโ€‹

List packages in the global install directory instead of in the current project.

--prod, -Pโ€‹

Only display the dependency tree for packages in dependencies.

--dev, -Dโ€‹

Only display the dependency tree for packages in devDependencies.

--only-projectsโ€‹

Added in: v7.22.0

Display only dependencies that are also projects within the workspace.

--filter <package_selector>โ€‹

Read more about filtering.