Skip to content
Latchkey

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              # interactive

Common 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

Run this faster and cheaper on Latchkey managed runners. Start free →