-
Couldn't load subscription status.
- Fork 3.8k
Closed
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next stepsRelease 8.xwork is associated with a specific npm 8 releasework is associated with a specific npm 8 release
Description
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
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 tonpm install --location=global stylelint. - Run
npm run test. - Note that
stylelintis installed locally and added as a dependency inpackage.json.
Environment
- npm:
8.11.0 - Node.js:
v16.15.0 - OS Name:
Windows 10(64-bit)
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next stepsRelease 8.xwork is associated with a specific npm 8 releasework is associated with a specific npm 8 release