pnpm update: Usage, Options & Common Errors
Upgrade dependencies and update pnpm-lock.yaml.
pnpm update (alias pnpm up) raises dependencies to newer versions and rewrites pnpm-lock.yaml, with flags for latest versions and workspace-wide updates.
What it does
Updates packages to the newest version allowed by their package.json ranges; --latest ignores ranges and goes to the newest published (updating package.json). -r updates across all workspaces, and -i runs an interactive picker.
Common usage
Terminal
pnpm update # in-range updates
pnpm update --latest # jump to latest, update package.json
pnpm up -r typescript # update across all workspaces
pnpm update -i # interactiveCommon CI gotcha: update rewrites the lockfile
Running pnpm update in CI changes pnpm-lock.yaml and then breaks the next --frozen-lockfile install. Do updates locally, commit the new lockfile, and keep CI on pnpm install --frozen-lockfile.
Terminal
# locally:
pnpm update && git add pnpm-lock.yaml && git commit -m "deps"Related guides
pnpm ERR_PNPM_OUTDATED_LOCKFILE - Fix Frozen Lockfile Failure in CIFix pnpm ERR_PNPM_OUTDATED_LOCKFILE "Cannot install with frozen-lockfile because pnpm-lock.yaml is not up to…
pnpm install: Usage, Options & Common CI Errorspnpm install resolves dependencies into the content-addressable store and links node_modules. Usage, --frozen…
npm update: Usage, Options & Common Errorsnpm update upgrades dependencies within their semver ranges and rewrites the lockfile. Usage, what it will an…