-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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] --location=global
does not work from package.json
scripts
#4945
Comments
This issue may be specific to Windows - on Linux I do see the deprecation warning and the dependency is installed globally as expected. |
--location=global is a bit long to type out each time on the command line. IMHO, would be an improvement if some shorter mnemonic could be added, like -g or something... |
Yeah... like it used to be. |
Confusingly, this does appear to work on a different Windows PC. Same version of Windows, same version of node, same version of npm, same (default) config, same terminal (cmd.exe), so I don't know what could be causing it... By the way I agree that there should be at least |
Issue #4989 makes me wonder if this bug is the result of the seemingly indirect way that In that issue, we see that some module bundled with node In this issue, perhaps the problem is that node |
I figured out the cause of this: I somehow had another version of npm installed at |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
I noticed the deprecation warning for
--global
and changed over to--location=global
. However I found that this doesn't work from scripts inpackage.json
. The parameter seems to be silently ignored, whereas--global
works and with no deprecation warning. The same thing happens with--location global
,-L=global
and-L global
, all of which work outsidepackage.json
scripts.Expected Behavior
--location=global
(and other notations) should work frompackage.json
scripts. I would also expect the deprecation warning to be printed for--global
.Steps To Reproduce
npm init -y
).package.json
"test" script tonpm install --location=global stylelint
.npm run test
.stylelint
is installed locally and added as a dependency inpackage.json
.Environment
8.11.0
v16.15.0
Windows 10
(64-bit)The text was updated successfully, but these errors were encountered: