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.
pnpm
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.
Terminal
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.
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 ERR_PNPM_LOCKFILE_CONFIG_MISMATCH in CI - Fix Settings DriftFix ERR_PNPM_LOCKFILE_CONFIG_MISMATCH in CI when the lockfile was built with different settings than the curr…
npm ci "can only install with an existing package-lock.json" - Fix in CIFix "npm ci can only install with an existing package-lock.json" by committing a lockfile, since npm ci refus…