-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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] npm.cmd
uses deprecated switch -g
#4980
Comments
Same with |
we've reverted this deprecation in v8.12.1, so i'm closing this issue. thanks for the reports! |
Not solved! PowerShell
|
Issue still there on 8.12.1
It is solved by editing C:\Program Files\nodejs\npm.cmd |
Is there a way to re-open this issue or will updates keep coming through this feed? I too am having this issue still on 8.12.1. |
I'm having the same issue......on both versions |
Hi there, I had the same issue, this command solve the bug for me |
Issue is still here in npm 8.12.1 version:
|
Did you opened command prompt as Administrator? What OS are you running npm? @Gino16 |
I used Git Bash, my OS is Windows 10, its the same result when I open in cmd as Administrator @Dany-GP |
you can try to set the commands that come here |
Running Thank you, @nlf ! |
thx a lot |
can't find the lastest npm upgrade, need help. |
@weezyade
and select version 8.12.1 for installation. |
@nlf this is clearly not resolved, can we reopen it? |
I agree. The issue is not resolved. There is a workaround, but it shouldn't be necessary if a true resolution was found |
@NSExceptional @Hashsudo |
I understand. I believe that the reference is to the installer. It will not update via the installer and requires manual alterations via Powershell. That's what I meant anyway. I do agree though that it is resolved in the sense that following the steps in Powershell correct the issue. |
There are a half dozen comments here all saying the same thing: it was not fixed in 8.12.1. Just experienced this myself. |
I believe that many people are doing what I was initially by uninstalling and reinstalling via the installer trying to update. It will not update that way. Still, the Powerhsell steps do fix the issue. So, in that sense, 8.12.1 is a fix. |
This does not look right. Please try only the |
All right, I think I need to wait for my teachers help, I belive if I can talk to him he may understand what you are saying. this is greek for me, im really thankful for your help. |
Firstly it didn't work at me but in that time i didn't save it 😅🤦♂️ |
|
OK! ok!.. UHUHUHUHHUH.. Obrigado! |
// Resolvido |
Finally works 👍 :) Thanks |
**This worked for me, C:/WINDOWS/system32>npm-windows-upgrade --npm-version latest Upgrading npm (fallback method)... | Upgrade finished. Your new npm version is 8.12.2. Have a nice day! C:\WINDOWS\system32>npm -v |
As Administrator run
|
|
PS> npm --version
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
8.19.2
PS> node -v
v16.16.0
PS> Get-Command npm
CommandType Name Version Source
----------- ---- ------- ------
Application npm.cmd 0.0.0.0 C:\Program Files\nodejs\npm.cmd
PS> Get-ComputerInfo OsName,OsVersion,OsBuildNumber,OsHardwareAbstractionLayer,WindowsVersion
OsName : Microsoft Windows 11 Enterprise
OsVersion : 10.0.22000
OsBuildNumber : 22000
OsHardwareAbstractionLayer : 10.0.22000.778
WindowsVersion : 2009 Is the official fix for this error to run the following?
Or will this be fixed in via an update? So we can just run |
@snebjorn As I understand the installation of npm on Windows, npm-windows-upgrade is the way to go. |
I just upgraded npm by opening |
--global was erroneously deprecated in node v16.15.1 and npm v8.12.0 on Windows. npm/cli#4980 npm/cli#4982
--global was erroneously deprecated in node v16.15.1 and npm v8.12.0 on Windows. npm/cli#4980 npm/cli#4982
--global was erroneously deprecated in node v16.15.1 and npm v8.12.0 on Windows. npm/cli#4980 npm/cli#4982
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
When invoking
npm --version
on Windows there is a warning about a deprecated commandline switch:Expected Behavior
No warning when no deprecated switch is used.
Steps To Reproduce
After upgrading npm to version 8.12.0 with npm-windows-upgrade
npm
always shows a warning on every execution about the deprecated switch-g
.Environment
The text was updated successfully, but these errors were encountered: