Is there an existing issue for this?
Current Behavior
In npm < 7.20.0, this writes foo=bar to the global npm config file (/usr/local/etc/npmrc).
In npm >= 7.20.0, the -g flag is not respected and foo=bar is written to the user npm config file (~/.npmrc).
Expected Behavior
The -g flag should result in a modification to the global config, not the user config.
Steps To Reproduce
- Run
npm set -g foo bar.
- Run
npm get.
- Note that
foo has been set in the user config rather than the global config.
Environment
- OS: macOS 10.15.7
- Node: 14.17.3
- npm: 7.20.0
Is there an existing issue for this?
Current Behavior
In npm < 7.20.0, this writes
foo=barto the global npm config file (/usr/local/etc/npmrc).In npm >= 7.20.0, the
-gflag is not respected andfoo=baris written to the user npm config file (~/.npmrc).Expected Behavior
The
-gflag should result in a modification to the global config, not the user config.Steps To Reproduce
npm set -g foo bar.npm get.foohas been set in the user config rather than the global config.Environment