Skip to content

[BUG] npm v 8.11.0 - writes to STDERR - "npm WARN config global --global, --local ..." breaking our nightly build process. #4989

@raven1152

Description

@raven1152

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.

npm-warn

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

  1. In Windows...
  2. Running node 16.15.1 and npm 8.11.0
  3. Run any npm command, i.e. npm -v
  4. See results...
    npm output

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsRelease 8.xwork is associated with a specific npm 8 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions