-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
current version of npm (8.11.0, node 16.15.1) writes a warning to STDERR on every command, that is a warning about using deprecated options. The message is...
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
The message is written to STDERR regardless of whether or not the command run uses the --global or --local options. For example, the command...
npm -v
outputs the message, even though -v is the only option used, and writes to STDERR, even though it states it's purpose to be a warning, not an error, and the command still executes successfully.
The result for my organization is to break our nightly builds. Our builds need to monitor STDERR for REAL build errors, which also use STDERR to capture a variety of aberrant build conditions including security vulnerabilities that are reported back to the build pipeline via STDERR in a script that runs "npm audit" and analyzes the results.
Expected Behavior
IMHO, this warning should only be written if the deprecated options are used, and should be written to STDOUT since it is not an error, just a warning.
Steps To Reproduce
Environment
- npm: 8.11.0
- Node.js: 16.15.1
- OS Name: Windows 10
- System Model Name: Dell Precision 5500 series
- npm config:
; "user" config from C:\Users\xxxx\.npmrc
cafile = "C:\\cert\\OGS_int_CA.pem"
; node bin location = C:\Program Files\nodejs\node.exe
; node version = v16.15.1
; npm local prefix = C:\Users\xxxx
; npm version = 8.11.0
; cwd = C:\Users\xxxx
; HOME = C:\Users\xxxx
; Run `npm config ls -l` to show all defaults.