pnpm install
Aliases: i
pnpm install
is used to install all dependencies for a project.
CI 環境では、ロックファイルが存在しても更新が必要な場合はインストールは失敗します。
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
コマンド | 意味 |
---|---|
pnpm i --offline | ストアからのみオフラインでインストールする |
pnpm i --frozen-lockfile | pnpm-lock.yaml is not updated |
pnpm i --lockfile-only | Only pnpm-lock.yaml is updated |
Options for filtering dependencies
Without a lockfile, pnpm has to create one, and it must be consistent regardless of dependencies
filtering, so running pnpm install --prod
on a directory without a lockfile would still resolve the
dev dependencies, and it would error if the resolution is unsuccessful. The only exception for this rule
are link:
dependencies.
Without --frozen-lockfile
, pnpm will check for outdated information from file:
dependencies, so
running pnpm install --prod
without --frozen-lockfile
on an environment where the target of file:
has been removed would error.
--prod, -P
- Default: false
- Type: Boolean
If true
, pnpm will not install any package listed in devDependencies
and will remove
those insofar they were already installed.
If false
, pnpm will install all packages listed in devDependencies
and dependencies
.
--dev, -D
Only devDependencies
are installed and dependencies
are removed insofar they
were already installed.
--no-optional
optionalDependencies
are not installed.