Skip to content

Instantly share code, notes, and snippets.

@isaacs
Created June 17, 2021 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaacs/c02d6c2f72cbbbb0c7c5be856d8bac8a to your computer and use it in GitHub Desktop.
Save isaacs/c02d6c2f72cbbbb0c7c5be856d8bac8a to your computer and use it in GitHub Desktop.
diff --git a/lib/diff.js b/lib/diff.js
index dac7c81f..1f8eff0f 100644
--- a/lib/diff.js
+++ b/lib/diff.js
@@ -145,9 +145,9 @@ const allChildren = node => {
if (!node)
return new Map()
- // if the node is a global root, and also a link, then what we really
+ // if the node is root, and also a link, then what we really
// want is to traverse the target's children
- if (node.global && node.isRoot && node.isLink)
+ if (node.isRoot && node.isLink)
return allChildren(node.target)
const kids = new Map()
@isaacs
Copy link
Author

isaacs commented Jun 17, 2021

Basically, we should be doing this always, not just for global installs. Not sure why we had that restriction.

@zthxxx
Copy link

zthxxx commented Jun 17, 2021

when npm ci with workspaces, both isRoot and isLink are true

@isaacs
Copy link
Author

isaacs commented Jun 21, 2021

Not necessarily. isRoot means "this is the root of the project". isLink means "this is a symlink (or at least, path !== realpath)".

It would be a case like:

mkdir foo
ln -s foo bar
cd bar
npm install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment