[JIRA] [nodejs-plugin] (JENKINS-27170) "Provide Node & npm bin/ folder to PATH" not working for "npm install"

320 views
Skip to first unread message

kristoffer@codedivision.com (JIRA)

unread,
Jul 1, 2015, 4:06:02 AM7/1/15
to jenkinsc...@googlegroups.com
Kristoffer Peterhänsel commented on Bug JENKINS-27170
 
Re: "Provide Node & npm bin/ folder to PATH" not working for "npm install"

Same sort of issue trying to install node-sass

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

philporada@gmail.com (JIRA)

unread,
Jul 6, 2015, 4:56:01 PM7/6/15
to jenkinsc...@googlegroups.com

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

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

philporada@gmail.com (JIRA)

unread,
Jul 6, 2015, 4:57:02 PM7/6/15
to jenkinsc...@googlegroups.com

philporada@gmail.com (JIRA)

unread,
Jul 6, 2015, 4:57:05 PM7/6/15
to jenkinsc...@googlegroups.com
Phil Porada edited a comment on Bug JENKINS-27170
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
{noformat}

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
{noformat}

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

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

kristoffer@codedivision.com (JIRA)

unread,
Jul 6, 2015, 5:18:01 PM7/6/15
to jenkinsc...@googlegroups.com

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 Marcin Stanisławski . So it awaits review now.

scm_issue_link@java.net (JIRA)

unread,
Aug 19, 2015, 2:14:02 PM8/19/15
to jenkinsc...@googlegroups.com

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_issue_link@java.net (JIRA)

unread,
Aug 19, 2015, 2:14:02 PM8/19/15
to jenkinsc...@googlegroups.com

eduardo.zamin@gmail.com (JIRA)

unread,
Jun 29, 2016, 5:49:02 AM6/29/16
to jenkinsc...@googlegroups.com
Eduardo Zamin updated an issue
Change By: Eduardo Zamin
Attachment: nodejs-plugin.png
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

eduardo.zamin@gmail.com (JIRA)

unread,
Jun 29, 2016, 5:50:01 AM6/29/16
to jenkinsc...@googlegroups.com
Eduardo Zamin commented on Bug JENKINS-27170
 
Re: "Provide Node & npm bin/ folder to PATH" not working for "npm install"

I came accross this issue yesterday, just to find out that it has already been fixed

When do you plan to make a release? The last release on the Jenkins Plugins website dates from 10-Feb-2014:

varma.pinnelli@gmail.com (JIRA)

unread,
Oct 5, 2016, 12:49:05 PM10/5/16
to jenkinsc...@googlegroups.com

Running below commands with windows batch command,

Error : C:\scratch\jenkins\workspace\xxxx\cartridges>call gulp css
'gulp' is not recognized as an internal or external command,
operable program or batch file.

set NODE_PATH=%AppData%\npm\node_modules
call npm config set registry http://registry.npmjs.org/
call npm install
call npm install -g gulp
call npm install -g gulp-cli
call npm install --save gulp-install
call npm install --save-dev gulp
call gulp css

Can anyone suggest on this.

varma.pinnelli@gmail.com (JIRA)

unread,
Oct 5, 2016, 12:50:01 PM10/5/16
to jenkinsc...@googlegroups.com
Raghu Pinnelli reopened an issue
 
Change By: Raghu Pinnelli
Resolution: Fixed
Status: Resolved Reopened

nfalco79@hotmail.com (JIRA)

unread,
Nov 23, 2016, 5:55:02 AM11/23/16
to jenkinsc...@googlegroups.com
Nikolas Falco updated an issue
Change By: Nikolas Falco
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"?

{code}
$ /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 karm...@0.0.4: wanted: {"node":"~0.8 || ~0.10"} (current: {"node":"0.12.0","npm":"2.5.1"})
npm WARN engine ka...@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 fsev...@0.3.5

> phan...@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

> w...@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...@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! phan...@1.9.15 install: `node install.js`
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the phan...@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

{code}

nfalco79@hotmail.com (JIRA)

unread,
Dec 11, 2016, 9:25:02 AM12/11/16
to jenkinsc...@googlegroups.com

scm_issue_link@java.net (JIRA)

unread,
Dec 11, 2016, 10:44:04 AM12/11/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Nicolas De Loof
Path:

src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstaller.java
http://jenkins-ci.org/commit/nodejs-plugin/9a44fe8e046e6aaf85f5abcd45e006780c460dd5


Log:
[FIXED JENKINS-27170] add node to PATH while running npm

  1. Conflicts:
  2. src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstallation.java

scm_issue_link@java.net (JIRA)

unread,
Dec 11, 2016, 10:44:04 AM12/11/16
to jenkinsc...@googlegroups.com

nfalco79@hotmail.com (JIRA)

unread,
Dec 11, 2016, 11:07:01 AM12/11/16
to jenkinsc...@googlegroups.com
Nikolas Falco commented on Bug JENKINS-27170
 
Re: "Provide Node & npm bin/ folder to PATH" not working for "npm install"

This issue was resolved by ndeloof in the commit https://github.com/jenkinsci/nodejs-plugin/commit/f38e0a5d20a747d235dd1c439ebb92eef4b0fe8f
I've try without any local system nodejs package and I have same issue. With local system nodejs package (nodejs >=6) I get the JENKINS-33698 behaviour.

christophe.feraud@cnamts.fr (JIRA)

unread,
Jan 31, 2017, 3:53:02 AM1/31/17
to jenkinsc...@googlegroups.com
Christophe FERAUD reopened an issue
 

Hello,

It seems this issue is back with plugin's version 1.0, but apparently just on master node :
Jenkins ver. 2.32.1 & Jenkins ver. 2.19.1

I check "Provide Node & npm bin/ folder to PATH", an echo of $PATH shows only the system's and user's bins, and the build hangs with "npm not found" in console log.

I've try same build on the same machine but configured as slave, the echo $PATH show the value expected with the NodeJS bin path.

The same build with the 0.2.2 plugin version works fine.

Change By: Christophe FERAUD
Resolution: Fixed
Status: Resolved Reopened

nfalco79@hotmail.com (JIRA)

unread,
Jan 31, 2017, 7:16:02 AM1/31/17
to jenkinsc...@googlegroups.com
 
Re: "Provide Node & npm bin/ folder to PATH" not working for "npm install"

Do you have EnvInject plugin installed?
If yes than also you have fall in JENKINS-26583

The 0.2.2 use a different old way to inject node js in PATH variable that cause problem similar problem to other plugin.

nfalco79@hotmail.com (JIRA)

unread,
Jan 31, 2017, 7:17:01 AM1/31/17
to jenkinsc...@googlegroups.com
Nikolas Falco edited a comment on Bug JENKINS-27170
Do you have EnvInject plugin installed?
If yes than also you have fall in JENKINS-26583

The 0.2.2 use a different old way (and old) to inject node js in PATH variable that cause problem similar problem to other plugin plugins .

nfalco79@hotmail.com (JIRA)

unread,
Jan 31, 2017, 7:18:01 AM1/31/17
to jenkinsc...@googlegroups.com
Nikolas Falco edited a comment on Bug JENKINS-27170
Do you have EnvInject plugin installed?
If yes than also you have fall in JENKINS-26583

The 0.2.2 use a different way (and old) to inject node js in PATH variable that cause similar problem to other plugins.

Workaround is remove EnvInject plugin, or make a custom build of workaround-26583 branch. (this branch will never merge into master, it's a EnvInject plugin issue not nodejs)

christophe.feraud@cnamts.fr (JIRA)

unread,
Jan 31, 2017, 7:50:05 AM1/31/17
to jenkinsc...@googlegroups.com

It's definitively a EnvInject plugin issue -> JENKINS-26583.

The nodejs plugin works as expected if I check the EnvInject check box even if I do not have variables to inject.

Thank for your reply.

nfalco79@hotmail.com (JIRA)

unread,
Jan 31, 2017, 7:57:02 AM1/31/17
to jenkinsc...@googlegroups.com
Nikolas Falco closed an issue as Fixed
 

Thank you

Change By: Nikolas Falco
Status: Reopened Closed
Resolution: Fixed

lars.velle@kantega.no (JIRA)

unread,
Feb 6, 2017, 8:32:03 AM2/6/17
to jenkinsc...@googlegroups.com
Lars Velle commented on Bug JENKINS-27170
 
Re: "Provide Node & npm bin/ folder to PATH" not working for "npm install"

This issues seems to have reappeared.

With Environment Injector Plugin installed the system version of node/npm is used, and not custom NodeJS Installations from "Provide Node & npm bin/ folder to PATH"

Jenkins version 2.44
Issues with both Environment Injector Plugin 1.93.1 and 1.92.1.

Disabling Environment Injector Plugin makes the problem go away.

d.wilmer.1980@googlemail.com (JIRA)

unread,
Feb 21, 2017, 3:26:03 AM2/21/17
to jenkinsc...@googlegroups.com
Daniel Wilmer reopened an issue
 

Since we also have the same issue, I will reopen this issue instead of creating a new one.

Change By: Daniel Wilmer
Resolution: Fixed
Status: Closed Reopened

nfalco79@hotmail.com (JIRA)

unread,
Feb 21, 2017, 3:44:03 AM2/21/17
to jenkinsc...@googlegroups.com
 
Re: "Provide Node & npm bin/ folder to PATH" not working for "npm install"

Do you have EnvInject plugin installed?
If yes than also you have fall in
JENKINS-26583
The 0.2.2 use a different way (and old) to inject node js in PATH variable that cause similar problem to other plugins.
Workaround is remove EnvInject plugin, or make a custom build of workaround-26583 branch. (this branch will never merge into master, it's a EnvInject plugin issue not nodejs)

d.wilmer.1980@googlemail.com (JIRA)

unread,
Feb 21, 2017, 4:04:04 AM2/21/17
to jenkinsc...@googlegroups.com

Yes, I have EnvInject installed. So I will stay on 0.2.2 until JENKINS-26583 is fixed.

nfalco79@hotmail.com (JIRA)

unread,
Feb 21, 2017, 4:29:05 AM2/21/17
to jenkinsc...@googlegroups.com
Nikolas Falco resolved as Fixed
 
Change By: Nikolas Falco
Status: Reopened Resolved
Resolution: Fixed

nfalco79@hotmail.com (JIRA)

unread,
Feb 21, 2017, 12:42:02 PM2/21/17
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages