Skip to content

vp install ​

Install the dependencies declared by the project. Alias: vp i. Supplying package names switches to add behavior.

bash
vp install
vp install --frozen-lockfile
vp install --lockfile-only
vp install --filter web
vp install react

Options ​

OptionDescriptionNotes
-P, --prodSelect production dependencies or save added packages to dependencies.
-D, --devInclude development dependencies or save added packages to devDependencies.
--no-optionalDo not install optionalDependencies.
--frozen-lockfilePrevent lockfile changes.Overrides an earlier --no-frozen-lockfile.
--no-frozen-lockfileExplicitly allow lockfile updates.Overrides an earlier --frozen-lockfile.
--lockfile-onlyUpdate the lockfile without a full install.
--prefer-offlineUse cached packages when available.
--offlineOnly use packages already in cache.
-f, --forceRequest a forced reinstall.
--ignore-scriptsDo not run lifecycle scripts.
--no-lockfileSkip reading or generating a lockfile.
--fix-lockfileRepair lockfile entries.Cannot be combined with package names.
--shamefully-hoistCreate a flat node_modules layout.
--resolution-onlyRe-run dependency resolution for analysis.Cannot be combined with package names.
--silentSuppress Vite+ output and request native quiet output.
--filter <pattern>Select workspaces by pattern.Can be repeated.
-w, --workspace-rootSelect the workspace root.
-E, --save-exactSave an exact dependency version.Requires package names.
--save-peerRequest the manager's peer-dependency save behavior.Requires package names.
-O, --save-optionalSave to optionalDependencies.Requires package names.
--save-catalogSave the dependency to the default catalog.Requires package names.
-g, --globalInstall globally.Requires the global CLI. Uses the global package store. Requires package names.
--node <version>Node.js version to use for global installation.Requires --global.
--concurrency <number>Number of global package installs to run in parallel.Requires --global. Must be a positive integer.

Compatibility ​

The commands below describe project operations. Global mode is described under Options.

  • npm: npm install, or npm ci with --frozen-lockfile and no package names. With package names: npm install.
  • pnpm: pnpm install. With package names: pnpm add.
  • Yarn Classic: yarn install. With package names: yarn add.
  • Yarn Modern: yarn install. With package names: yarn add.
  • Bun: bun install. With package names: bun add.
OptionnpmpnpmYarn ClassicYarn ModernBunNotes
-P, --prodYesYesYesWith package namesYesYarn Modern only warns in install mode.
-D, --devYesYesYesWith package namesYes
--no-optionalYesYesYesNoYes
--frozen-lockfileWithout package namesWithout package namesYesWithout package namesYes
--no-frozen-lockfileWithout package namesWithout package namesWithout package namesWithout package namesYes
--lockfile-onlyWithout --frozen-lockfileYesNo3 or laterYesnpm ignores this in CI mode.
--prefer-offlineYesYesYesNo1.4.1 or later
--offlineYesYesYesNo1.4.1 or later
-f, --forceWithout --frozen-lockfileYesYesNoYesnpm ignores this in CI mode.
--ignore-scriptsYesYesYesYesYesOn Yarn Modern, lockfile-only mode takes priority.
--no-lockfileWithout --frozen-lockfileYesYesNoNonpm ignores this in CI mode.
--fix-lockfileNoYesNoYesNo
--shamefully-hoistNoYesNoNoNo
--resolution-onlyNoYesNoNoNo
--silentYesYesYesNoYes
--filter <pattern>YesYesNoYesInstall: Yes. Add: 1.4 or later.
-w, --workspace-rootYesYesWith package namesNoNo
-E, --save-exactYesYesYesYesYes
--save-peerYesYesYesYesYes
-O, --save-optionalYesYesYesYesYes
--save-catalogNoYesNoNo1.4 or later
-g, --globalYesYesYesYesYes
--node <version>YesYesYesYesYes
--concurrency <number>YesYesYesYesYes

With package names, add compatibility rules apply.

Git and Remote Tarball Dependencies ​

npm 12 disables git dependencies and remote tarball URLs by default. Installs can fail with EALLOWGIT or EALLOWREMOTE. Opt in through npm's project allow-git or allow-remote configuration only when those sources are intended.

For dependency build-script approval, see approve-builds.

Native Options ​

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