pnpm "ERR_PNPM_OUTDATED_LOCKFILE" with --frozen-lockfile in CI
CI runs pnpm install --frozen-lockfile, which forbids changing pnpm-lock.yaml. pnpm found the lockfile out of sync with one or more package.json files and refuses to proceed, so the stale lockfile must be regenerated and committed.
What this error means
A pnpm install --frozen-lockfile (or pnpm i in CI) step fails with "ERR_PNPM_OUTDATED_LOCKFILE Cannot install with \"frozen-lockfile\" because pnpm-lock.yaml is not up to date with <manifest>".
ERR_PNPM_OUTDATED_LOCKFILE Cannot install with "frozen-lockfile" because
pnpm-lock.yaml is not up to date with packages/api/package.jsonCommon causes
A package.json changed without relocking
A dependency was added or bumped in a manifest, but pnpm-lock.yaml was not regenerated and committed alongside it.
A different pnpm version produced a different lockfile shape
The lockfile format or resolution differs between the local pnpm and the CI pnpm, so the committed lockfile looks outdated.
How to fix it
Regenerate and commit the lockfile
- Run
pnpm installlocally (without frozen) to updatepnpm-lock.yaml. - Commit the updated lockfile with the manifest change.
- Re-run CI so the frozen install matches.
pnpm install
git add pnpm-lock.yamlPin pnpm so versions match
Use the same pnpm version locally and in CI via packageManager so lockfile shape is consistent.
{
"packageManager": "pnpm@9.7.0"
}How to prevent it
- Commit
pnpm-lock.yamlwith every manifest change. - Pin pnpm with the
packageManagerfield so CI matches local. - Keep
--frozen-lockfilein CI to catch drift early.