Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(arborist): load actual tree on named updates #4306

Merged
merged 1 commit into from
Jan 26, 2022

Conversation

ruyadorno
Copy link
Contributor

@ruyadorno ruyadorno commented Jan 21, 2022

Arborist was not loading the actual tree when using named updates for
global updates, that would result in removing all previously installed
deps from a global install anytime the user would try to run
npm update <pkgname>.

This changeset fixes the problem by allowing the load of the actual tree
if the global and update.names options are defined.

Added a few more tests to illustrate but some of the snapshots already
included were actually demonstrating the problem by having empty trees
as result, these are now also updated with the expected tree result.

References

Fixes: #3175

Arborist was not loading the actual tree when using named updates for
global updates, that would result in removing all previously installed
deps from a global install anytime the user would try to run
`npm update <pkgname>`.

This changeset fixes the problem by allowing the load of the actual tree
if the `global` and `update.names` options are defined.

Added a few more tests to illustrate but some of the snapshots already
included were actually demonstrating the problem by having empty trees
as result, these are now also updated with the expected tree result.

Fixes: npm#3175
@ruyadorno ruyadorno requested a review from a team as a code owner January 21, 2022 19:54
@ruyadorno ruyadorno merged commit 1f853f8 into npm:release-next Jan 26, 2022
@wraithgar wraithgar mentioned this pull request Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants