pnpm lock file updates always fail with ERR_PNPM_OUTDATED_LOCKFILE when pnpm-workspace.yaml sets frozenLockfile: true #44675
Unanswered
aronstrandberg
asked this question in
Request Help
Replies: 1 comment
-
|
Fix PR: #44676 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
How are you running Renovate?
Self-hosted:
renovatebot/github-actionv46.1.19 (Renovate43.260.3) on a pnpm 11 monorepo. The relevant code is unchanged onmain, so this reproduces there too.Describe the problem
If a repository's
pnpm-workspace.yamlsetsfrozenLockfile: true(a drift guard so bare localpnpm installnever rewrites the lock file — pnpm 11 reads settings frompnpm-workspace.yaml), then every npm-manager branch fails artifact generation:Renovate records an artifact error and pushes branches with manifest edits but no
pnpm-lock.yamlupdate. Every PR then fails CI at install time and carries arenovate/artifacts=failurestatus. The failure is deterministic — the lock file is out of date by construction because Renovate just edited the manifest.Root cause
generateLockFile()runspnpm install --lockfile-only [--recursive] [--ignore-scripts --ignore-pnpmfile]with no frozen-lockfile handling (lib/modules/manager/npm/post-update/pnpm.ts). On the pnpm side:--lockfile-onlycarve-out, but the carve-out only applies whilefrozen-lockfileis unset; an explicitly-set value skips it (install.ts)pnpm-workspace.yamlsettings;pnpm_config_*/npm_config_*env vars lose to them (acknowledged by the pnpm maintainers inconfig/reader/src/index.tsL941–953)So there is no self-hosted config workaround: no env var can override the setting, and Renovate's pnpm invocation accepts no extra flags. Affected repos must choose between their local drift guard and working Renovate pnpm updates.
Note: the
pnpm update --no-save … --lockfile-onlypath (rangeStrategy=update-lockfile) is not affected — pnpm's frozen mode only gates plain installs (andpnpm updaterejects frozen-lockfile flags entirely).Minimal reproduction
https://github.com/aronstrandberg/renovate-pnpm-frozen-lockfile-repro — one workspace package with an outdated
left-pad, valid lock file, andfrozenLockfile: true. The readme includes a 3-command pnpm-only transcript (fails without--no-frozen-lockfile, succeeds with it, pnpm 11.5.3).Proposed fix
Append
--no-frozen-lockfileto thepnpm install --lockfile-onlycommand (only there —pnpm updateneither needs nor accepts it). A lock file regeneration command can never meaningfully run frozen. This mirrors two merged precedents that made lock file updates override repo-level "immutable install" settings:--install.frozen-lockfile truefrom.yarnrc; Berry usesYARN_ENABLE_IMMUTABLE_INSTALLS=false)--frozen=falsedefault to update lock file correctly #43058 (deno install --frozen=false, "we should always override thefrozenflag")I have a PR ready with the one-line change plus updated tests (link in the first comment).
Beta Was this translation helpful? Give feedback.
All reactions