-
-
Notifications
You must be signed in to change notification settings - Fork 33k
Description
Version
16.15.1
Platform
Microsoft Windows NT 10.0.19044.0 x64
Subsystem
No response
What steps will reproduce the bug?
Invoke npm, for example with npm --version
.
How often does it reproduce? Is there a required condition?
Every invocation of npm.
What is the expected behavior?
No warning.
What do you see instead?
npm WARN config global --global
, --local
are deprecated. Use --location=global
instead.
Additional information
- The warning triggers regardless of the installed version of npm - it even triggers after downgrading to npm
8.10.0
(which precedes the deprecation warning) or upgrading to npm8.12.1
(which undeprecates--local
and--global
). - I don't see the warning on Linux.
- In the npm cli repo [BUG] npm v 8.11.0 - writes to STDERR - "npm WARN config global
--global
,--local
..." breaking our nightly build process. npm/cli#4989 was filed about this issue, but as (1) indicates, this is not something that comes directly from npm.
So I think node 16.15.1
includes some component responsible for invoking npm on Windows that triggers the warning, and this module does not get updated if you run npm install -g npm@latest
. I suspect that this also caused npm/cli#4945 where I found that package.json
scripts did not support the new --location
parameter on Windows while using node v16.15.0
.
To fix this bug it should be enough to just update the npm-related bundles that node includes, but it would be nice if npm install -g npm@latest
also updated the module responsible for this issue on Windows.