-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next stepsRelease 8.xwork is associated with a specific npm 8 releasework is associated with a specific npm 8 release
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
Running npm -g update serverless@pre-3 wipes the content of the global node_modules directory (/usr/local/lib/node_modules).
Here is a log file of the command: https://gist.github.com/mnapoli/0170614e3f4ab1915a82783bf871d033
Here is what I tried to pinpoint the problem:
- no problem with a local install (
npm update serverless@pre-3) npm -g i pure-promptworksnpm -g update pure-promptworksnpm -g i serverlessworksnpm -g update serverlessworksnpm -g i serverless@pre-3worksnpm -g update serverless@pre-3❌ wipes everythingyarn global add serverlessworksyarn global update serverless@pre-3works
Expected Behavior
Nothing should be removed, the package should be installed.
Steps To Reproduce
Run:
npm -g update serverless@pre-3
Now all global dependencies are gone (e.g. serverless, npm, etc.). The global folder /usr/local/lib/node_modules still exists, but it's empty.
I have to reinstall NPM and reinstall all global NPM dependencies.
Environment
- npm: 8.3.0
- Node.js: v17.3.1
- OS Name: macOS
- System Model Name: Bug Sur 11.6.2
- npm config:
; "builtin" config from /usr/local/lib/node_modules/npm/npmrc
prefix = "/usr/local"
; "user" config from /Users/matthieu/.npmrc
//npm.pkg.github.com/:_authToken = (protected)
//registry.npmjs.org/:_authToken = (protected)
; node bin location = /usr/local/Cellar/node/17.3.1/bin/node
; cwd = /Users/matthieu/dev/PHP/bref
; HOME = /Users/matthieu
; Run `npm config ls -l` to show all defaults.Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next stepsRelease 8.xwork is associated with a specific npm 8 releasework is associated with a specific npm 8 release