Skip to content

vp pm prune ​

Remove unnecessary installed packages.

bash
vp pm prune
vp pm prune --prod

Options ​

OptionDescriptionNotes
--prodRemove devDependencies.
--no-optionalRemove optional dependencies.

Compatibility ​

  • npm: npm prune.
  • pnpm: pnpm prune.
  • Yarn Classic: No command. Warns and exits successfully without performing the operation.
  • Yarn Modern: No command. Warns and exits successfully without performing the operation.
  • Bun: 1.4 or later: bun prune. Earlier versions warn and skip.
OptionnpmpnpmYarn ClassicYarn ModernBunNotes
--prodYesYesNoNo1.4 or later
--no-optionalYesYesNoNo1.4 or later

npm translates selection flags to --omit=dev and --omit=optional. Bun translates --prod to --production. Yarn and older Bun remove extraneous packages during installation instead of providing a native prune command.

Native Options ​

For native options, see npm prune, pnpm prune, and Bun prune. To pass these options through Vite+, see Native Arguments.