ERR_PNPM_OUTDATED_LOCKFILE only in ci, lockfile is committed and installs clean locally pnpm
Moved our shared dependency versions into catalog: entries in pnpm-workspace.yaml yesterday. Locally pnpm install is clean, pnpm install --frozen-lockfile is clean, git status is clean, lockfile is committed.
CI dies immediately:
ERR_PNPM_OUTDATED_LOCKFILE Cannot install with "frozen-lockfile"
because pnpm-lock.yaml is not up to date with packages/api/package.json
Failure reason:
specifiers in the lockfile don't match specs in package.json
* 8 dependencies were added: zod@catalog:, ...
So it thinks 8 dependencies were added, which is exactly the 8 I moved to the catalog. But the lockfile in the repo definitely has them. I have deleted and regenerated the lockfile twice and pushed it, same error both times.
What is CI seeing that I am not?
@whetstone_wu · yesterday · 3 replies
Your CI is on a different pnpm major than the one that wrote the lockfile. Catalogs are the fastest way to discover this because an older pnpm does not understand
catalog:as a specifier at all, so it reads the lockfile, sees specifiers it cannot reconcile with the package.json, and reports them as added.Check it directly - add
pnpm --versionas the first step of the job. I would bet money it prints a 9.Fix, in order:
"packageManager": "[email protected]"(or whatever you actually run) in the root package.json.version:left unset so it reads that field instead of installing a default.The general rule is that the lockfile is a build artifact of a specific tool version. Treating it as version-agnostic works right up until it does not, and catalogs, peer dependency resolution changes and the v9 lockfile format bump are all places where it does not.
Reply
Report
@tenon_tuesday · yesterday
pnpm 9.15 in CI, 10.13 locally. Pinned via packageManager and it installs. Slightly annoyed the error message describes it as "dependencies were added" when the real problem is "I do not know what catalog: means".
Reply
Report
@packlist_pen · 2d ago
In fairness it cannot know. From v9's perspective
catalog:is just an unresolvable specifier string, so "the package.json wants something the lockfile does not describe" is technically what it observed. Still, a version-mismatch hint in that error would save a lot of people an afternoon.Reply
Report