Skip to content

vp why ​

Explain why a dependency is installed. Alias: vp explain.

bash
vp why react
vp why react --json
vp why react --filter web

Options ​

OptionDescriptionNotes
--jsonRequest native JSON output.Output retains the native schema.
--longShow extended information.
--parseableShow parseable output.
-r, --recursiveCheck recursively across all workspaces.
--filter <pattern>Select workspaces by pattern.Can be repeated.
-w, --workspace-rootCheck in workspace root.
-P, --prodOnly production dependencies.
-D, --devOnly dev dependencies.
--depth <depth>Limit tree depth.
--no-optionalExclude optional dependencies.
--exclude-peersExclude peer dependencies.
--find-by <finder_name>Use a finder function defined in .pnpmfile.cjs.

Compatibility ​

  • npm: npm explain.
  • pnpm: pnpm why.
  • Yarn Classic: yarn why. With multiple package names, warns and checks only the first.
  • Yarn Modern: yarn why. With multiple package names, warns and checks only the first.
  • Bun: bun why.
OptionnpmpnpmYarn ClassicYarn ModernBunNotes
--jsonYesYesYesYesNo
--longNoYesNoNoNo
--parseableNoYesNoNoNo
-r, --recursiveYesYesNoYesNo
--filter <pattern>YesYesNoNoNo
-w, --workspace-rootNoYesNoNoNo
-P, --prodNoYesNoNoNo
-D, --devNoYesNoNoNo
--depth <depth>NoYesNoNoYes
--no-optionalNoYesNoNoNo
--exclude-peersNoYesNoYesNoYarn Modern includes peers by default.
--find-by <finder_name>NoYesNoNoNo

The dependency graph does not include tools Vite+ bundles or compiles. For readable output, Vite+ shows a hint when it also provides the requested package. Use vp toolchain [tool] to inspect bundled tools.

Native Options ​

For native options, see npm explain, pnpm why, Yarn why, Yarn Classic why, and Bun why. To pass these options through Vite+, see Native Arguments.