-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[BUG] npm update -g package@latest
removes all global packages
#3175
Comments
Likely related: #3159 |
I am astonished that this hasn't been fixed for months! NPM just removed all my global packages. A workaround is to use |
Just faced the same issue with Environment:
|
I reported and closed #4240 as duplicate of this issue. Note that it seems to be the I can reproduce it with any version number (all dependencies get wiped out anyway). I also reproduce it with NPM v8. |
See npm/cli#3175 why `npm update` is broken.
See npm/cli#3175 why `npm update` is broken.
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
See npm/cli#3175 why `npm update` is broken.
See npm/cli#3175 why `npm update` is broken.
See npm/cli#3175 why `npm update` is broken.
See npm/cli#3175 why `npm update` is broken.
See npm/cli#3175 why `npm update` is broken.
See npm/cli#3175 why `npm update` is broken.
See npm/cli#3175 why `npm update` is broken.
See npm/cli#3175 why `npm update` is broken.
See npm/cli#3175 why `npm update` is broken.
Current Behavior:
Attempting to update a package with a tag using the
update
command globally causes ALL global packages to be removed.Expected Behavior:
Packages should not be removed when updating global packages.
Steps To Reproduce:
Environment:
Additional Info
This only happens on the global scope
The text was updated successfully, but these errors were encountered: