pnpm ERR_PNPM_OUTDATED_LOCKFILE in CI - Fix Lockfile Out of Sync
pnpm runs with --frozen-lockfile by default in CI. ERR_PNPM_OUTDATED_LOCKFILE means installing would change pnpm-lock.yaml, so package.json and the lockfile disagree.
What this error means
The CI install step fails with ERR_PNPM_OUTDATED_LOCKFILE, noting that the lockfile is not up to date with package.json. Locally pnpm install succeeds because it can update the lockfile.
ERR_PNPM_OUTDATED_LOCKFILE Cannot perform a frozen installation
because the lockfile is not up to date with package.json
* 1 dependencies were added: left-pad@^1.3.0Common causes
package.json changed without updating the lockfile
A dependency was added or bumped without re-running pnpm install, so pnpm-lock.yaml lags behind.
The lockfile was not committed
A regenerated lockfile stayed local, so CI checks out a stale version.
How to fix it
Regenerate and commit the lockfile
- Run pnpm install locally to update pnpm-lock.yaml.
- Commit the lockfile so CI is in sync.
pnpm install
git add pnpm-lock.yaml
git commit -m "Update pnpm-lock.yaml"How to prevent it
- Commit pnpm-lock.yaml with every dependency change, pin pnpm via packageManager, and keep --frozen-lockfile in CI so drift fails fast before merge.