pnpm
toolspnpmReferenceBeginner
pnpm install (Clean & CI Install)
Deterministic and frozen-lockfile installation command for CI/CD and production environments with pnpm.
Verified: 2026-09-30
Tested on:pnpm 12.x, node 22.x
Platforms:
all
#pnpm#node#package-manager#ci
Command
pnpm install --frozen-lockfile
Short Description
pnpm install --frozen-lockfile installs packages strictly according to pnpm-lock.yaml. If pnpm-lock.yaml is out of date or needs updating, the command aborts and fails with an exit code, guaranteeing deterministic builds in CI/CD pipelines.
Common Flags
| Flag | Purpose |
|---|---|
--frozen-lockfile | Strict CI flag; errors if lockfile is modified or out of sync. |
--prod, -P | Install only dependencies, ignoring devDependencies. |
--prefer-offline | Skip network checks for packages already in local store. |
--shamefully-hoist | Hoists all dependencies to flat node_modules (useful for legacy packages). |