Skip to content

[BUG] npm update -g package@latest removes all global packages #3175

Closed
@mukaschultze

Description

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:

npm i -g typescript nodemon @angular/cli # Install some global packages
npm ls -g --depth=0 # This shows the 3 installed packages
npm update -g @angular/cli@latest # Attempt to update one of the packages with a @latest tag
# Oh no! removed 620 packages
npm ls -g --depth=0 # Shows `-- (empty)

Environment:

  • OS: Windows 10 20H2
  • Node: 15.9.0
  • npm: 7.11.2

Additional Info

This only happens on the global scope

Metadata

Assignees

Labels

Bugthing that needs fixingPriority 1high priority issueRelease 7.xwork is associated with a specific npm 7 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions