0

I'm having some trouble running "npm" from Jenkins as a shell script. I added the NodeJS plugin for Jenkins and specified the latest version which I believe is 5.x. On my job configuration screen, I can successfully run "node --version", but when I try to run "npm --version" I'm getting this error:

+ node --version
v4.2.2
+ npm --version
module.js:339
    throw err;
    ^

Error: Cannot find module 'are-we-there-yet'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> 

Any idea what might be causing the issue? Maybe something is broken with the NodeJS plugin?

Brandon
  • 2,886
  • 3
  • 29
  • 44
  • Possible duplicate of [npm doesnt work, get always this error -> Error: Cannot find module 'are-we-there-yet'](http://stackoverflow.com/questions/31025048/npm-doesnt-work-get-always-this-error-error-cannot-find-module-are-we-ther) – Tomasz Jakub Rup Dec 02 '15 at 18:48
  • It's different because this is related to Jenkins' NodeJS plugin. Wondering if there is a config issue that might be causing this. – Brandon Dec 02 '15 at 18:57

2 Answers2

0

This seems to be the this issue: https://issues.jenkins-ci.org/browse/JENKINS-27845
The Jenkins nodejs plugin seems to have problems on OSX and Windows.

escapedcat
  • 726
  • 10
  • 31
-1

Easy fix, you need to install NPM on the Jenkins box. See https://nodejs.org/en/download

Bardia D.
  • 693
  • 3
  • 8