diff --git a/.changeset/metal-wasps-impress.md b/.changeset/metal-wasps-impress.md new file mode 100644 index 00000000000..6fec366c340 --- /dev/null +++ b/.changeset/metal-wasps-impress.md @@ -0,0 +1,6 @@ +--- +"@pnpm/core": patch +"pnpm": patch +--- + +Return early when the lockfile is up-to-date. diff --git a/packages/core/src/install/index.ts b/packages/core/src/install/index.ts index b2c1170e779..cdc9fb08f77 100644 --- a/packages/core/src/install/index.ts +++ b/packages/core/src/install/index.ts @@ -265,7 +265,6 @@ export async function mutateModules ( opts.frozenLockfileIfExists && ctx.existsWantedLockfile if ( !ctx.lockfileHadConflicts && - !opts.lockfileOnly && !opts.update && !opts.fixLockfile && installsOnly && @@ -289,6 +288,9 @@ export async function mutateModules ( hint: 'Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"', }) } + if (opts.lockfileOnly) { + return projects + } if (!ctx.existsWantedLockfile) { if (ctx.projects.some((project) => pkgHasDependencies(project.manifest))) { throw new Error(`Headless installation requires a ${WANTED_LOCKFILE} file`)