You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(arborist): omit failed optional dependencies from installed deps (#8184)
… but keep them 'in the tree'
This PR was authored by @zkatFixes: #4828Fixes: #7961
Replaces: #8127
Replaces: #8077
When optional dependencies fail, we don't want to install them, for
whatever reason. The way this "uninstallation" is done right now is by
simply removing the dependencies from the ideal tree during reification.
Unfortunately, this means that what gets saved to the "hidden lockfile"
is the edited ideal tree as well, and when npm runs next, it'll use that
when regenerating the "real" package-lock.
This PR tags failed optional deps such that they're still added to the
"trash list" (and thus have their directories cleaned up by the
reifier), but prevents Arborist from removing them altogether from the
ideal tree (which is usually done by setting their parent to `null`,
making them unreachable, and letting them get GC'd).
PS: It's Friday, this is what I managed to get done together. I'm making
this a draft PR for now so folks can look at it, but I want to make sure
both reifiers work well, fix some messaging issues, and clean stuff up
(I'm pretty sure I'm guarding `ideallyInert` in more places than I need
to, because I was trying to find the right spot). Still, feel free to
talk about the approach. I'll get back to this on Monday.
PPS: also hi
Co-authored-by: Kat Marchán <[email protected]>
0 commit comments