pnpm Cheat Sheet/Explain why a package is present

Show why a package is installed in the dependency graph.

Section: Run, Exec, and Inspect

Explain why a package is present

bash
bash
pnpm why react
Explanation

Show why a package is installed in the dependency graph.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Run, Exec, and Inspect
List installed packages
Show installed packages in a tree structure.
OpenIn sheetbashsame section
List top-level packages
Show only top-level dependencies.
OpenIn sheetbashsame section
Show outdated dependencies
List dependencies with newer versions available.
OpenIn sheetbashsame section
Print store path
Show the location of the content-addressable store.
OpenIn sheetbashsame section
Run a package script
Run a script from package.json.
OpenIn sheetbashsame section
Run script via shorthand
Run a script without typing run when there is no command ambiguity.
OpenIn sheetbashsame section