fix: partial install in workspace with patches should not fail (#4956)

close #4954
This commit is contained in:
Zoltan Kochan
2022-06-30 11:55:42 +03:00
committed by GitHub
parent b55b3782d8
commit 5e0e7f5dbb
2 changed files with 11 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
---
"@pnpm/resolve-dependencies": patch
"pnpm": patch
---
`pnpm install` in a workspace with patches should not fail when doing partial installation [#4954](https://github.com/pnpm/pnpm/issues/4954).

View File

@@ -103,7 +103,11 @@ export default async function (
} = await resolveDependencyTree(projectsToResolve, opts)
// We only check whether patches were applied in cases when the whole lockfile was reanalyzed.
if (opts.patchedDependencies && (opts.forceFullResolution || !opts.wantedLockfile.packages?.length)) {
if (
opts.patchedDependencies &&
(opts.forceFullResolution || !opts.wantedLockfile.packages?.length) &&
Object.keys(opts.wantedLockfile.importers).length === importers.length
) {
verifyPatches(Object.keys(opts.patchedDependencies), appliedPatches)
}