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 in package.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 outside package.json scripts.
Expected Behavior
--location=global (and other notations) should work from package.json scripts. I would also expect the deprecation warning to be printed for --global.
Steps To Reproduce
- From a fresh npm project (
npm init -y).
- Set the
package.json "test" script to npm install --location=global stylelint.
- Run
npm run test.
- Note that
stylelint is installed locally and added as a dependency in package.json.
Environment
- npm:
8.11.0
- Node.js:
v16.15.0
- OS Name:
Windows 10 (64-bit)
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
I noticed the deprecation warning for
--globaland 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--globalworks and with no deprecation warning. The same thing happens with--location global,-L=globaland-L global, all of which work outsidepackage.jsonscripts.Expected Behavior
--location=global(and other notations) should work frompackage.jsonscripts. 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.stylelintis installed locally and added as a dependency inpackage.json.Environment
8.11.0v16.15.0Windows 10(64-bit)