Skip to content

[BUG] Use of deprecated -g option in update notification  #5299

Description

@dhmmasson

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

The notification message is currently :
npm notice Run npm install -g npm@8.17.0 to update!

Expected Behavior

it should read
npm notice Run npm install --location=global npm@8.17.0 to update!
since using -g prompt the following message :
npm WARN config global --global, --localare deprecated. Use--location=global instead.

Steps To Reproduce

Install a previous version of npm

npm install -g npm@8.11.0
npm install -g  npm@8.17.0

a better behavior is the following

npm install --location=global npm@8.11.0
npm install --location=global  npm@8.17.0

Environment

  • npm: 8.17.0
  • Node.js:16.15.1
  • OS Name: Mac Os
  • System Model Name: Macbook Pro
  • npm config:
; "user" config from /Users/dimitri/.npmrc

python = "/usr/local/bin/python3.9" 

; node bin location = /Users/dimitri/.nvm/versions/node/v16.15.1/bin/node
; node version = v16.15.1
; npm local prefix = /Users/dimitri/Documents/workspace
; npm version = 8.17.0
; cwd = /Users/dimitri/Documents/workspace
; HOME = /Users/dimitri
; Run `npm config ls -l` to show all defaults.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsRelease 8.xwork is associated with a specific npm 8 release

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions