Skip to content

Commit

Permalink
fix: partial install in workspace with patches should not fail
Browse files Browse the repository at this point in the history
close #4954
  • Loading branch information
zkochan committed Jun 30, 2022
1 parent b55b378 commit 660d2b3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/cold-toes-push.md
@@ -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).
6 changes: 5 additions & 1 deletion packages/resolve-dependencies/src/index.ts
Expand Up @@ -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)
}

Expand Down

0 comments on commit 660d2b3

Please sign in to comment.