Open
Description
Is there an existing issue for this?
- I have searched the existing issues
This issue exists in the latest npm version
- I am using the latest npm
Current Behavior
Title. Basically self-destructs and purges all global packages and you can't even run npm after.
As I have tested, it works with any package that is not installed, even non-existent ones.
npm update -g [non-installed package]
To fix it, you need to re-install whole Node again with nvm.
Expected Behavior
Don't self-destruct and delete all global packages, when you specify package that is not installed.
Steps To Reproduce
- run
npm update -g ds
- get the result
removed 203 packages in 641ms
The batch file cannot be found.
- try to run npm again
npm -v
'npm' is not recognized as an internal or external command,
operable program or batch file.
- become aware of your unimportance to the universe
Environment
- npm: probably was 10.8.2, but I cannot check it because npm itself doesn't exist anymore.
- Node.js: 22.6.0 (64-bit) via nvm
- OS Name: Windows 10
- npm config: cannot give you, as stated above.