From 820934207a4fddc676b020a2bc5d326df351695d Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Wed, 24 Apr 2024 14:59:58 +0200 Subject: [PATCH] fix: don't upgrade the lockfile format during frozen lockfile install (#8006) close #7991 --- .changeset/quick-walls-report.md | 6 ++++++ pkg-manager/core/src/install/index.ts | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changeset/quick-walls-report.md diff --git a/.changeset/quick-walls-report.md b/.changeset/quick-walls-report.md new file mode 100644 index 0000000000..4d3aba2a3a --- /dev/null +++ b/.changeset/quick-walls-report.md @@ -0,0 +1,6 @@ +--- +"@pnpm/core": patch +"pnpm": patch +--- + +Don't upgrade the lockfile format on `pnpm install --frozen-lockfile` [#7991](https://github.com/pnpm/pnpm/issues/7991). diff --git a/pkg-manager/core/src/install/index.ts b/pkg-manager/core/src/install/index.ts index f110d6c17d..9444de69c0 100644 --- a/pkg-manager/core/src/install/index.ts +++ b/pkg-manager/core/src/install/index.ts @@ -471,7 +471,10 @@ Note that in CI environments, this setting is enabled by default.`, wantedLockfile: maybeOpts.ignorePackageManifest ? undefined : ctx.wantedLockfile, useLockfile: opts.useLockfile && ctx.wantedLockfileIsModified, }) - if (opts.useLockfile && opts.saveLockfile && opts.mergeGitBranchLockfiles || !upToDateLockfileMajorVersion) { + if ( + opts.useLockfile && opts.saveLockfile && opts.mergeGitBranchLockfiles || + !upToDateLockfileMajorVersion && !opts.frozenLockfile + ) { await writeLockfiles({ currentLockfile: ctx.currentLockfile, currentLockfileDir: ctx.virtualStoreDir,