Page MenuHomePhabricator

Add npm-debug.log to build artifacts
Open, MediumPublic

Description

CI job 61747 failed with an npm error (fixed since then), referencing /mnt/jenkins-workspace/workspace/mediawiki-core-qunit/src/npm-debug.log, but that file is not retained. That file should be included in the build artifacts.

Jenkins console output:

+ rm -rf node_modules 
+ npm install
npm WARN deprecated lodash@0.9.2: Grunt needs your help! See https://github.com/gruntjs/grunt/issues/1403.
npm WARN deprecated graceful-fs@1.2.3: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible. 
npm WARN optional dep failed, continuing fsevents@1.0.8
WARN engine is-buffer@1.1.3: wanted: {"node":">=0.12"} (current: {"node":"0.10.25","npm":"2.14.12"})
WARN engine is-buffer@1.1.3: wanted: {"node":">=0.12"} (current: {"node":"0.10.25","npm":"2.14.12"})
WARN engine is-buffer@1.1.3: wanted: {"node":">=0.12"} (current: {"node":"0.10.25","npm":"2.14.12"})
npm ERR! Linux 3.13.0-77-generic
npm ERR! argv "node" "/usr/bin/npm" "install"
npm ERR! node v0.10.25
npm ERR! npm  v2.14.12

npm ERR! version not found: left-pad@0.0.3
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /mnt/jenkins-workspace/workspace/mediawiki-core-qunit/src/npm-debug.log
Build step 'Execute shell' marked build as failure

Event Timeline

hashar added subscribers: Krinkle, hashar.

https://gerrit.wikimedia.org/r/#/c/175112/ @Krinkle commented about archiving npm-debug-log being usually useless:

@Krinkle wrote:

When a job using npm causes a failure, there should already be a sufficient level of verbosity in the console output. npm-debug.log is mostly for later reference. If you found it useful it the past, it's fine by me, but just checking whether it's theoretical or not.

@hashar wrote:

Per Timo, npm output errors to stdout. The npm-debug.log doesn't offer much more information.

I have edited the task detail and copy pasted the relevant part form the console output. The root cause is shown:

npm ERR! version not found: left-pad@0.0.3

The package got removed from the npm central repository: https://medium.com/@azerbike/i-ve-just-liberated-my-modules-9045c06be67c#.l6xo7moqs

Maybe we can pass --color=always to the npm commands. Might make the error to stand out.

I don't know how useful the debug log is in general. In that specific case, I wanted to look at it because the error message gave no indication where the dependency comes from (it's not in package.json).