Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

fix: if there are children but the diff itself has an action, make sure to add it to leaves #233

Closed
wants to merge 1 commit into from

Conversation

nlf
Copy link
Contributor

@nlf nlf commented Feb 17, 2021

this problem is most easily highlighted with the dependency aws-cdk which for some reason when you npm ci after installing, never makes it to the leaves and so is never reified. we do reify its children, but not that node itself.

this change does pass the hands on test, and the changes to the diff look correct to me (and do seem to show the exact bug that i'm trying to fix)

References

Fixes npm/cli#2251

@isaacs isaacs closed this in b0e5ce3 Feb 18, 2021
isaacs added a commit that referenced this pull request Feb 18, 2021
We loop over the diff.leaves to find all the shrinkwraps that _must_ be
unpacked ahead of time in order to complete the idealTree.  However, if
the idealTree already contains the children of the shrinkwrap-containing
module (because it's been previously installed and saved to a lockfile),
then we saw the hasShrinkwrap flag, and assumed it had already been
unpacked.

This tracks a Set of all nodes unpacked for the purposes of reading
their shrinkwraps, and only skips _those_ modules at unpackNewModules.

Different approach than #233, without adding extra items into the
diff.leaves, which can have the side effect of calling mkdirp more than
necessary.

Close: #233
Fix: npm/cli#2251
Reviewed-by: @nlf
@wraithgar wraithgar deleted the nlf/dont-skip-children-with-actions branch April 22, 2021 17:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] npm install followed by npm ci fails with no such file or directory (chmod failure)
1 participant