Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] <title>npm WARN config global --global, --local are deprecated. Use --location=global instead. #5228

Closed
2 tasks done
FunTeaMan opened this issue Jul 28, 2022 · 3 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release

Comments

@FunTeaMan
Copy link

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

npm WARN config global --global, --local are deprecated. Use --location=global instead.

Expected Behavior

no more"npm WARN config global --global, --local are deprecated. Use --location=global instead."

Steps To Reproduce

  1. In this environment...
  2. With this config...
  3. Run '...'
  4. See error...

Environment

  • npm:8.15.0
  • Node.js:16.15.1
  • OS Name:Win10
  • System Model Name:Omen 16
  • npm config:
C:\Users\Tang>npm help npm
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
@FunTeaMan FunTeaMan added Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release labels Jul 28, 2022
@jeffreyrivor
Copy link

jeffreyrivor commented Jul 28, 2022

Seems like the issue is from https://github.com/nodejs/node/blob/main/deps/npm/bin/npm.cmd#L12 which seems to come from https://github.com/npm/cli/blob/latest/bin/npm.cmd#L12

It's using 'CALL "%NODE_EXE%" "%NPM_CLI_JS%" prefix -g' instead of the new argument 'CALL "%NODE_EXE%" "%NPM_CLI_JS%" prefix --location=global'.

@wraithgar
Copy link
Member

This is a duplicate of #4989 and #4980. There was a single version of node that shipped with an erroneously deprecated -g flag. Updating your node version should clear this, or you can read the other issues for more suggestions.

@shuangwhywhy
Copy link

This is the commit which caused the issue:

\`--global\`, \`--local\` are deprecated. Use \`--location=global\` instead.

And here is the diff:
8898710

Since the issue appears in the npm (v8.11.0) published along with the LTS version of node (16.16.0). I strongly suggest that node LTS minor version should be updated and bind with npm >= 8.13.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release
Projects
None yet
Development

No branches or pull requests

4 participants