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
CI install with frozen lockfile
pnpm install --frozen-lockfile

# Common CI install pattern that refuses lockfile changes.

Fetch packages into virtual store
pnpm fetch

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

Install production deps only
pnpm install --prod

# Install only production dependencies.

Prune to production deps
pnpm prune --prod

# Remove devDependencies from an existing install.

Update lockfile only
pnpm install --lockfile-only

# Refresh the lockfile without changing node_modules.

## Environment and Node Runtime
List installed Node.js versions
pnpm env list

# Show Node versions installed by pnpm env.

Use a specific Node version
pnpm env use --global 22

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

Remove a Node version
pnpm env remove --global 20.11.1

# Remove a previously installed Node.js version.

Print binary directory
pnpm bin

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

Print node_modules root
pnpm root

# Show the root node_modules path for the current project.

## Patch, Review, and Troubleshooting
Patch a dependency
pnpm patch lodash@4.17.21

# Extract a dependency for local edits before creating a patch.

Commit dependency patch
pnpm patch-commit ./node_modules/.ignored/lodash@4.17.21

# Create and register a patch after editing an extracted dependency.

Rebuild dependencies
pnpm rebuild

# Re-run dependency build scripts.

Check pnpm setup health
pnpm doctor

# Diagnose common pnpm environment issues.

Install while ignoring scripts
pnpm install --ignore-scripts

# Avoid running package lifecycle scripts during install.

Approve dependency builds
pnpm approve-builds

# Review and approve dependencies allowed to run build scripts.

List ignored dependency builds
pnpm ignored-builds

# Show packages whose build scripts were skipped by policy.

Recommended next

No recommendations yet.