Cli: [BUG] npm run is broken

Created on 23 Aug 2020  ·  3Comments  ·  Source: npm/cli

Current Behavior:

$ npx -qp [email protected] -c 'npm run'
start:webpack-dev-server --open
build:NODE_ENV=production webpack -p

$ npx -qp [email protected] -c 'npm run'
npm timing config:load:defaults Completed in 1ms
...
npm timing npm:load Completed in 25ms
npm run-script <command> [-- <args>]

aliases: run, rum, urn
npm timing npm Completed in 155ms

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ahu/.npm/_logs/2020-08-23T00_18_04_815Z-debug.log

Expected Behavior:

$ npx -qp [email protected] -c 'npm run'
start:webpack-dev-server --open
build:NODE_ENV=production webpack -p

Steps To Reproduce:

  1. npx -qp [email protected] -c 'npm run'

Environment:

  • OS: macOS Catalina 10.15.6
  • Node: 12.18.3
  • npm: 6.14.6
  • npx: 6.14.6
Bug Needs Triage Release 7.x

All 3 comments

Root cause: https://github.com/npm/config/issues/2

We should be skipping env values of '' rather than putting them in the configuration object.

Isn’t the empty string distinct from unset?

It is, but unfortunately npm 6 did not respect this distinction appropriately.

Fixed in latest beta.

Was this page helpful?
0 / 5 - 0 ratings