From 461d76a2e55889a4b53c752c77170a92e4f97335 Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Tue, 16 Apr 2024 16:00:00 +0200 Subject: [PATCH] fix: frozen lockfile should work with lockfile v6 (#7935) close #7934 --- .changeset/khaki-coats-enjoy.md | 6 ++++++ pkg-manager/core/src/install/index.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/khaki-coats-enjoy.md diff --git a/.changeset/khaki-coats-enjoy.md b/.changeset/khaki-coats-enjoy.md new file mode 100644 index 0000000000..e08f99be5a --- /dev/null +++ b/.changeset/khaki-coats-enjoy.md @@ -0,0 +1,6 @@ +--- +"@pnpm/core": patch +"pnpm": patch +--- + +`pnpm install --frozen-lockfile` should work with lockfiles generated by pnpm v8, if they don't need updates [#7934](https://github.com/pnpm/pnpm/issues/7934). diff --git a/pkg-manager/core/src/install/index.ts b/pkg-manager/core/src/install/index.ts index 0589138ef2..84799b3448 100644 --- a/pkg-manager/core/src/install/index.ts +++ b/pkg-manager/core/src/install/index.ts @@ -353,7 +353,7 @@ export async function mutateModules ( } let needsFullResolution = outdatedLockfileSettings || opts.fixLockfile || - !ctx.wantedLockfile.lockfileVersion.toString().startsWith(`${LOCKFILE_MAJOR_VERSION}.`) || + !ctx.wantedLockfile.lockfileVersion.toString().startsWith(`${LOCKFILE_MAJOR_VERSION}.`) && ctx.wantedLockfile.lockfileVersion !== LOCKFILE_VERSION_V6 || opts.forceFullResolution if (needsFullResolution) { ctx.wantedLockfile.settings = {