[BUG] npm 7.5.x is deleting all packages when one package is updated (global) #2736
Labels
Bug
thing that needs fixing
Priority 1
high priority issue
Release 7.x
work is associated with a specific npm 7 release
Current Behavior:
All my global packages are being deleted when I run an
npm update -g ...
command, except for the package that I'm updating. This has been happening for at least a month. Currently it's happening with npm 7.5.4, but I think it was also happening with earlier 7.5.x releases. See the screenshot below.Expected Behavior:
It should just update the specified package. It should not delete any packages.
Steps To Reproduce:
npm install -g npm@latest
. Currently this installs npm 7.5.4.npm install -g ...
.npm -g outdated
.npm update -g eslint
.npm ls -g --depth=0
.C:\Users\Joe\AppData\Roaming\npm\node_modules
. All module folders are gone, except for the package you just updated.npm -g -v
. It says npm 6.14.10, probably the version that shipped with Node 14.15.5. npm deleted itself too, at least the updated version.Screenshot captures everything:
Environment:
The text was updated successfully, but these errors were encountered: