pnpm CI, Env, and Patching

CI installs, fetch, production pruning, Node runtime management, patching, and troubleshooting.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all

CI and Lockfiles

Reliable installs for CI pipelines.

CI install with frozen lockfile

Common CI install pattern that refuses lockfile changes.

bashANYpnpmcilockfile
bash
pnpm install --frozen-lockfile

Common CI install pattern that refuses lockfile changes.

Fetch packages into virtual store

Fetch packages into the store without linking node_modules; useful in image builds.

bashANYpnpmfetchcistore
bash
pnpm fetch

Fetch packages into the store without linking node_modules; useful in image builds.

Install production deps only

Install only production dependencies.

bashANYpnpminstallprod
bash
pnpm install --prod

Install only production dependencies.

Prune to production deps

Remove devDependencies from an existing install.

bashANYpnpmpruneprod
bash
pnpm prune --prod

Remove devDependencies from an existing install.

Update lockfile only

Refresh the lockfile without changing node_modules.

bashANYpnpmlockfile
bash
pnpm install --lockfile-only

Refresh the lockfile without changing node_modules.

Environment and Node Runtime

Manage Node.js runtimes and environment context.

List installed Node.js versions

Show Node versions installed by pnpm env.

bashANYpnpmenvnode
bash
pnpm env list

Show Node versions installed by pnpm env.

Use a specific Node version

Install and activate a Node.js version globally through pnpm.

bashANYpnpmenvnode
bash
pnpm env use --global 22

Install and activate a Node.js version globally through pnpm.

Remove a Node version

Remove a previously installed Node.js version.

bashANYpnpmenvnode
bash
pnpm env remove --global 20.11.1

Remove a previously installed Node.js version.

Print binary directory

Show the directory where pnpm-linked binaries live for the current project.

bashANYpnpmbininspect
bash
pnpm bin

Show the directory where pnpm-linked binaries live for the current project.

Print node_modules root

Show the root node_modules path for the current project.

bashANYpnpmrootinspect
bash
pnpm root

Show the root node_modules path for the current project.

Patch, Review, and Troubleshooting

Patch dependencies and inspect health.

Patch a dependency

Extract a dependency for local edits before creating a patch.

bashANYpnpmpatchdependencies
bash
pnpm patch lodash@4.17.21

Extract a dependency for local edits before creating a patch.

Commit dependency patch

Create and register a patch after editing an extracted dependency.

bashANYpnpmpatchdependencies
bash
pnpm patch-commit ./node_modules/.ignored/lodash@4.17.21

Create and register a patch after editing an extracted dependency.

Rebuild dependencies

Re-run dependency build scripts.

bashANYpnpmrebuild
bash
pnpm rebuild

Re-run dependency build scripts.

Check pnpm setup health

Diagnose common pnpm environment issues.

bashANYpnpmdoctortroubleshooting
bash
pnpm doctor

Diagnose common pnpm environment issues.

Install while ignoring scripts

Avoid running package lifecycle scripts during install.

bashANYpnpminstallscriptssecurity
bash
pnpm install --ignore-scripts

Avoid running package lifecycle scripts during install.

Approve dependency builds

Review and approve dependencies allowed to run build scripts.

bashANYpnpmsecuritybuilds
bash
pnpm approve-builds

Review and approve dependencies allowed to run build scripts.

List ignored dependency builds

Show packages whose build scripts were skipped by policy.

bashANYpnpmsecuritybuilds
bash
pnpm ignored-builds

Show packages whose build scripts were skipped by policy.

Recommended next

No recommendations yet.