pnpm install in CI
pnpm installs from a global content-addressed store, hard-linking into node_modules.
pnpm is fast in CI because packages are cached once per machine. Use --frozen-lockfile for reproducible installs.
Common flags
--frozen-lockfile- fail if lockfile would change (default in CI)--prefer-offline- use the store first--store-dir- set store location for caching
Example in CI
Reproducible install.
shell
pnpm install --frozen-lockfileIn CI
Cache the pnpm store (pnpm store path) keyed on the lockfile. ERR_PNPM_OUTDATED_LOCKFILE means commit your updated pnpm-lock.yaml.
Key takeaways
--frozen-lockfileis the CI default.- Cache the pnpm store for speed.
- Outdated-lockfile errors mean commit the lock.