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

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

      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
      

          [JENKINS-27170] "Provide Node & npm bin/ folder to PATH" not working for "npm install"

          feng yu created issue -
          feng yu made changes -
          Description Original: 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.

          But the console log shows "node: command not found":

          $ /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
          New: 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

          Same sort of issue trying to install node-sass

          Kristoffer Peterhänsel added a comment - Same sort of issue trying to install node-sass

          Phil Porada added a comment - - edited

          This issue has been open since February. Is there any timeline on having a person assigned to it so that some action can be taken? I just set up a nodejs project that needs `npm install` to handle but am running into this issues stated here.

          Console output

          16:38:04 [VECO2.0] $ /bin/bash -xe /tmp/hudson941101738030232753.sh
          16:38:04 + npm install
          16:38:04 /tmp/hudson941101738030232753.sh: line 2: npm: command not found
          

          Jenkins agent node/npm location. Please see nodejs01.png for the Jenkins master configuration.

          [root@fin bin]# pwd ; ./node -v ; ./npm -v
          /opt/jenkins-tools/node-v0.12.6-linux-x64/bin
          v0.12.6
          2.11.2
          

          Phil Porada added a comment - - edited This issue has been open since February. Is there any timeline on having a person assigned to it so that some action can be taken? I just set up a nodejs project that needs `npm install` to handle but am running into this issues stated here. Console output 16:38:04 [VECO2.0] $ /bin/bash -xe /tmp/hudson941101738030232753.sh 16:38:04 + npm install 16:38:04 /tmp/hudson941101738030232753.sh: line 2: npm: command not found Jenkins agent node/npm location. Please see nodejs01.png for the Jenkins master configuration. [root@fin bin]# pwd ; ./node -v ; ./npm -v /opt/jenkins-tools/node-v0.12.6-linux-x64/bin v0.12.6 2.11.2
          Phil Porada made changes -
          Attachment New: nodejs01.png [ 30068 ]

          Well. As a matter of fact. I took it upon myself to fix it and submitted the PR#6 - which was then greatly improved by unilama. So it awaits review now.

          Kristoffer Peterhänsel added a comment - Well. As a matter of fact. I took it upon myself to fix it and submitted the PR#6 - which was then greatly improved by unilama . So it awaits review now.
          Kristoffer Peterhänsel made changes -
          Remote Link New: This issue links to "Pull Request with fix (Web Link)" [ 12968 ]

          Code changed in jenkins
          User: Nicolas De Loof
          Path:
          src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstallation.java
          src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstaller.java
          http://jenkins-ci.org/commit/nodejs-plugin/f38e0a5d20a747d235dd1c439ebb92eef4b0fe8f
          Log:
          [FIXED JENKINS-27170] add node to PATH while running npm

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas De Loof Path: src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstallation.java src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstaller.java http://jenkins-ci.org/commit/nodejs-plugin/f38e0a5d20a747d235dd1c439ebb92eef4b0fe8f Log: [FIXED JENKINS-27170] add node to PATH while running npm
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Eduardo Zamin made changes -
          Attachment New: nodejs-plugin.png [ 33167 ]

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

              Created:
              Updated:
              Resolved: