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

fix: undeprecate and remove warnings for --global, -g, --local #4982

Merged
merged 1 commit into from
Jun 2, 2022

Conversation

fritzy
Copy link
Contributor

@fritzy fritzy commented Jun 2, 2022

Internally, we made a mistake in deprecating --global, and are correcting that with this PR.

The original PR is here. #4879

This removes deprecation warnings and updates documentation.

@fritzy fritzy requested a review from a team as a code owner June 2, 2022 16:58
@nlf nlf merged commit 40c823c into latest Jun 2, 2022
@nlf nlf deleted the fritzy/undeprecate-global branch June 2, 2022 17:04
@nlf nlf mentioned this pull request Jun 2, 2022
@npm-cli-bot
Copy link
Collaborator

no statistically significant performance changes detected

timing results
app-large clean lock-only cache-only cache-only
peer-deps
modules-only no-lock no-cache no-modules no-clean no-clean
audit
npm@8 34.652 ±0.36 17.226 ±0.01 15.835 ±0.26 18.100 ±0.76 2.755 ±0.01 2.706 ±0.00 2.199 ±0.00 10.677 ±0.01 2.187 ±0.02 3.516 ±0.47
#4982 35.993 ±1.23 17.275 ±0.01 15.750 ±0.02 18.603 ±0.86 2.776 ±0.00 2.741 ±0.04 2.266 ±0.06 10.866 ±0.09 2.153 ±0.00 3.373 ±0.24
app-medium clean lock-only cache-only cache-only
peer-deps
modules-only no-lock no-cache no-modules no-clean no-clean
audit
npm@8 25.460 ±1.57 12.999 ±0.28 11.564 ±0.02 12.239 ±0.14 2.515 ±0.04 2.524 ±0.01 2.224 ±0.05 7.917 ±0.11 2.078 ±0.01 2.850 ±0.03
#4982 25.588 ±0.80 12.940 ±0.02 11.417 ±0.07 12.581 ±0.02 2.490 ±0.03 2.463 ±0.00 2.225 ±0.07 7.884 ±0.11 2.118 ±0.04 2.776 ±0.02

@nickserv
Copy link

nickserv commented Jun 8, 2022

I'm still getting the following error on 18.12.1. Is there a regression?

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

@U-C-S
Copy link

U-C-S commented Jun 8, 2022

Same, Still having it after updating with npm i -g npm@latest

image

EDIT:
nodejs/node#43323 (comment)

@yemymy
Copy link

yemymy commented Jun 8, 2022

I am using the latest version and seeing this problem --global

@hlp2020
Copy link

hlp2020 commented Jun 15, 2022

How to save this problem?

@bennycode
Copy link

Seems to be fine with v8.13.1. There are YouTubers advising to manually modify npm and npm.cmd which I don't think is advisable (https://www.youtube.com/watch?v=ySh16mC7Zws). Will report that to them.

@nuhaaM
Copy link

nuhaaM commented Jun 30, 2022

I still have that issue on the latest version v8.13.2
image

@bennycode
Copy link

I still have that issue on the latest version v8.13.2 image

In that case you can try this workaround 🙈: https://youtu.be/7xEgFfpUeEs?t=232

@ruyadorno
Copy link
Contributor

Seems to be fine with v8.13.1. There are YouTubers advising to manually modify npm and npm.cmd which I don't think is advisable (https://www.youtube.com/watch?v=ySh16mC7Zws). Will report that to them.

right, that sounds like whoever is still seeing this error message is getting it from the binary jumper thing that retrieves the global prefix in order to enable npm to use a diff (oftentimes updated) version of itself, ref:

cli/bin/npm

Line 23 in ef8d2ed

NPM_PREFIX=`"$NODE_EXE" "$NPM_CLI_JS" prefix -g`

A possible clean solution would be to uninstall node + npm (however you got it) and install it again.

@mrauhu
Copy link

mrauhu commented Jul 9, 2022

Right now this pull request is merged but not released.

@fritzy can you please bump the npm package version?

@awxiaoxian2020
Copy link

Right now this pull request is merged but not released.

@fritzy can you please bump the npm package version?

Any Response?

akikanellis added a commit to akikanellis/homelab that referenced this pull request Jan 4, 2023
`npm bin` was removed as part of npm [v9.0.0](https://github.com/npm/cli/releases/tag/v9.0.0).

Also npm first [deprecated](npm/cli#4879) `--global` but has since [undeprecated](npm/cli#4982) it.
raineorshine added a commit to raineorshine/npm-check-updates that referenced this pull request Sep 13, 2023
--global was erroneously deprecated in node v16.15.1 and npm v8.12.0 on Windows.

npm/cli#4980
npm/cli#4982
raineorshine added a commit to raineorshine/npm-check-updates that referenced this pull request Nov 3, 2023
--global was erroneously deprecated in node v16.15.1 and npm v8.12.0 on Windows.

npm/cli#4980
npm/cli#4982
raineorshine added a commit to raineorshine/npm-check-updates that referenced this pull request Nov 5, 2023
--global was erroneously deprecated in node v16.15.1 and npm v8.12.0 on Windows.

npm/cli#4980
npm/cli#4982
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.