pnpm install
Aliases: i
pnpm install
is used to install all dependencies for a project.
In a CI environment, installation fails if a lockfile is present but needs an update.
Inside a workspace, pnpm install
installs all dependencies in all the
projects. If you want to disable this behavior, set the recursive-install
setting to false
.
TL;DR
Command | Meaning |
---|---|
pnpm i --offline | Install offline from the store only |
pnpm i --frozen-lockfile | pnpm-lock.yaml is not updated |
pnpm i --lockfile-only | Only pnpm-lock.yaml is updated |
Options
--force
Force reinstall dependencies: refetch packages modified in store, recreate a lockfile and/or modules directory created by a non-compatible version of pnpm. Install all optionalDependencies even they don't satisfy the current environment(cpu, os, arch).
--offline
- Default: false
- Type: Boolean
If true
, pnpm will use only packages already available in the store.
If a package won't be found locally, the installation will fail.
--prefer-offline
- Default: false
- Type: Boolean
If true
, staleness checks for cached data will be bypassed, but missing data
will be requested from the server. To force full offline mode, use --offline
.
--prod, -P
pnpm will not install any package listed in devDependencies
and will remove
those insofar they were already installed, if the NODE_ENV
environment variable
is set to production. Use this flag to instruct pnpm to ignore NODE_ENV
and take
its production status from this flag instead.
--dev, -D
Only devDependencies
are installed and dependencies
are removed insofar they
were already installed, regardless of the NODE_ENV
.
--no-optional
optionalDependencies
are not installed.