Skip to content

Commit c81df49

Browse files
committed
install: fix checking for optional dep
See https://npm.community/t/2569
1 parent 03840dc commit c81df49

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/install/is-only-optional.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ function isOptional (node, seen) {
1010
if (seen.has(node) || node.requiredBy.length === 0) {
1111
return false
1212
}
13+
seen = new Set(seen)
1314
seen.add(node)
1415
const swOptional = node.fromShrinkwrap && node.package._optional
1516
return node.requiredBy.every(function (req) {

0 commit comments

Comments
 (0)