Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-27170

"Provide Node & npm bin/ folder to PATH" not working for "npm install"

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: nodejs-plugin
    • Labels:
    • Similar Issues:

      Description

      I followed the plugin doc that checked "Provide Node & npm bin/ folder to PATH", but it not works for npm install. You can see my screenshots.

      The execute shell command can works very well, but the console log shows "node: command not found", maybe not export the "$PATH"?

      $ /var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs-0.12.0/bin/npm install -g karma karma-cli karma-jasmine karma-junit-reporter karma-phantomjs-launcher karma-spec-reporter gulp gulp-concat gulp-sass gulp-minify-css gulp-rename
      npm WARN engine karma-cli@0.0.4: wanted: {"node":"~0.8 || ~0.10"} (current: {"node":"0.12.0","npm":"2.5.1"})
      npm WARN engine karma@0.12.31: wanted: {"node":"~0.8 || ~0.10"} (current: {"node":"0.12.0","npm":"2.5.1"})
      /var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs-0.12.0/bin/karma -> /var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs-0.12.0/lib/node_modules/karma-cli/bin/karma
      npm WARN optional dep failed, continuing fsevents@0.3.5
      
      > phantomjs@1.9.15 install /var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs-0.12.0/lib/node_modules/karma-phantomjs-launcher/node_modules/phantomjs
      > node install.js
      
      sh: node: Command not found
      
      > ws@0.4.32 install /var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs-0.12.0/lib/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
      > (node-gyp rebuild 2> builderror.log) || (exit 0)
      
      /var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs-0.12.0/bin/gulp -> /var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs-0.12.0/lib/node_modules/gulp/bin/gulp.js
      
      > node-sass@2.0.1 install /var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs-0.12.0/lib/node_modules/gulp-sass/node_modules/node-sass
      > node scripts/install.js
      
      sh: node: Command not found
      npm ERR! Linux 3.16.0-31-generic
      npm ERR! argv "/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs-0.12.0/bin/node" "/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs-0.12.0/bin/npm" "install" "-g" "karma" "karma-cli" "karma-jasmine" "karma-junit-reporter" "karma-phantomjs-launcher" "karma-spec-reporter" "gulp" "gulp-concat" "gulp-sass" "gulp-minify-css" "gulp-rename"
      npm ERR! node v0.12.0
      npm ERR! npm  v2.5.1
      npm ERR! code ELIFECYCLE
      
      npm ERR! phantomjs@1.9.15 install: `node install.js`
      npm ERR! Exit status 127
      npm ERR! 
      npm ERR! Failed at the phantomjs@1.9.15 install script 'node install.js'.
      npm ERR! This is most likely a problem with the phantomjs package,
      npm ERR! not with npm itself.
      npm ERR! Tell the author that this fails on your system:
      npm ERR!     node install.js
      npm ERR! You can get their info via:
      npm ERR!     npm owner ls phantomjs
      npm ERR! There is likely additional logging output above.
      npm ERR! Linux 3.16.0-31-generic
      npm ERR! argv "/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs-0.12.0/bin/node" "/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs-0.12.0/bin/npm" "install" "-g" "karma" "karma-cli" "karma-jasmine" "karma-junit-reporter" "karma-phantomjs-launcher" "karma-spec-reporter" "gulp" "gulp-concat" "gulp-sass" "gulp-minify-css" "gulp-rename"
      npm ERR! node v0.12.0
      npm ERR! npm  v2.5.1
      
      npm ERR! Uncaught, unspecified "error" event.
      npm ERR! 
      npm ERR! If you need help, you may report this error at:
      npm ERR!     <http://github.com/npm/npm/issues>
      
      npm ERR! Please include the following file with any support request:
      npm ERR!     /npm-debug.log
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                nfalco Nikolas Falco
                Reporter:
                abcfy2 feng yu
              • Votes:
                3 Vote for this issue
                Watchers:
                20 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: