[JIRA] [nodejs-plugin] (JENKINS-34815) NodeJS plugin unable to install global NPM packages

1,046 views
Skip to first unread message

whurley@forumone.com (JIRA)

unread,
May 13, 2016, 12:39:01 PM5/13/16
to jenkinsc...@googlegroups.com
William Hurley created an issue
 
Jenkins / Bug JENKINS-34815
NodeJS plugin unable to install global NPM packages
Issue Type: Bug Bug
Assignee: Unassigned
Components: nodejs-plugin
Created: 2016/May/13 4:38 PM
Environment: Official Jenkins Docker - version 2.3 (Alpine)

Plugins:
 - NodeJS 0.2.1
 - Pipeline 2.1

Browser: Chrome 50.0.2661

Added NodeJS Tool 6.1.0 as "Install from nodejs.org"
Priority: Minor Minor
Reporter: William Hurley

When attempting to add the tool to a pipeline with automatic installation of NPM modules the following error occurred:

Unpacking https://nodejs.org/dist/v6.1.0/node-v6.1.0-linux-x64.tar.gz to /var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/node-6.1.0 on Jenkins
$ /var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/node-6.1.0/bin/npm install -g grunt-cli bower
env: can't execute 'node': No such file or directory

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

markusschulte83@gmail.com (JIRA)

unread,
May 23, 2016, 4:57:02 AM5/23/16
to jenkinsc...@googlegroups.com
Markus Schulte commented on Bug JENKINS-34815
 
Re: NodeJS plugin unable to install global NPM packages

I can confirm this behaviour.

My workaround is, to add a Build-step "Execute shell" to each needed Jenkins-Job, as soon as possible in the build-pipeline, containing

npm update
npm install --global grunt

signusx7@gmail.com (JIRA)

unread,
Jun 18, 2016, 5:14:01 PM6/18/16
to jenkinsc...@googlegroups.com

I can also validate this issue. I have tested it on a fresh install of Jenkins 2.0 (v2.9 to be specific) with NodeJS v6.2.2. I have also done this for NodeJS 5.9, 6.0, 6.1, and 6.2.1. It appears that no version of NodeJS 6+ this works, but continues to work for versions <6.0.

When the tool itself is installing modules, the PATH is not set correctly. When running the build job, the PATH gets set correctly, so node and npm are available and I can print out the versions.

Unpacking https://nodejs.org/dist/v6.2.2/node-v6.2.2-linux-x64.tar.gz to /var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/node-6.2.2 on Jenkins
$ /var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/node-6.2.2/bin/npm install -g mocha istanbul eslint grunt-cli forever mocha-junit-reporter
/usr/bin/env: node: No such file or directory
[testnode1] $ /bin/sh -xe /tmp/hudson4410243541713209879.sh
+ echo /var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/node-6.2.2/bin:/sbin:/usr/sbin:/bin:/usr/bin
/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/node-6.2.2/bin:/sbin:/usr/sbin:/bin:/usr/bin
+ npm -v
3.9.5
+ node -v
v6.2.2
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

signusx7@gmail.com (JIRA)

unread,
Jun 18, 2016, 6:26:02 PM6/18/16
to jenkinsc...@googlegroups.com
Matthew Sexton edited a comment on Bug JENKINS-34815
I can also validate this issue. I have tested it on a fresh install of Jenkins 2.0 (v2.9 to be specific) with NodeJS v6.2.2. I have also done this for NodeJS 5.9, 6.0, 6.1, and 6.2.1. It appears that no version of NodeJS 6+ this works, but continues to work for versions <6.0.

When the tool itself is installing modules, the PATH is not set correctly. When running the build job, the PATH gets set correctly, so node and npm are available and I can print out the versions.

{code}

Unpacking https://nodejs.org/dist/v6.2.2/node-v6.2.2-linux-x64.tar.gz to /var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/node-6.2.2 on Jenkins
$ /var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/node-6.2.2/bin/npm install -g mocha istanbul eslint grunt-cli forever mocha-junit-reporter
/usr/bin/env: node: No such file or directory
# Build Step
[testnode1] $ /bin/sh -xe /tmp/hudson4410243541713209879.sh
+ echo /var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/node-6.2.2/bin:/sbin:/usr/sbin:/bin:/usr/bin
/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/node-6.2.2/bin:/sbin:/usr/sbin:/bin:/usr/bin
+ npm -v
3.9.5
+ node -v
v6.2.2
{code}

davividal@gmail.com (JIRA)

unread,
Jul 18, 2016, 7:49:01 PM7/18/16
to jenkinsc...@googlegroups.com

I can confirm that it correctly works for NodeJS < 6.0. Just tested it with 5.12.0.

davividal@gmail.com (JIRA)

unread,
Jul 20, 2016, 6:10:01 PM7/20/16
to jenkinsc...@googlegroups.com

I just manually built and installed 0.3 and it works.

signusx7@gmail.com (JIRA)

unread,
Jul 22, 2016, 1:56:02 PM7/22/16
to jenkinsc...@googlegroups.com

Davi Koscianski Vidal - By 0.3 you mean v6.3.0? I will test again with NodeJS 6.3.0 now that I am on Jenkins 2.14.

davividal@gmail.com (JIRA)

unread,
Jul 22, 2016, 2:37:01 PM7/22/16
to jenkinsc...@googlegroups.com

No Matthew Sexton. I cloned nodejs-plugin repository, built the plugin using maven and uploaded the resulting hpi. The built resulted in nodejs-plugin version 0.3.
With this up-to-date version I was able to install NodeJS 6.3.0 + global packages.

davividal@gmail.com (JIRA)

unread,
Jul 22, 2016, 2:38:01 PM7/22/16
to jenkinsc...@googlegroups.com
No [~signus]. I cloned nodejs-plugin repository, built the plugin using maven and uploaded the resulting hpi. The built resulted in nodejs-plugin version 0.3.

With this up-to-date version I was able to install NodeJS 6.3.0 + global packages.


Edit: sorry for my poor English.

signusx7@gmail.com (JIRA)

unread,
Jul 25, 2016, 12:01:03 PM7/25/16
to jenkinsc...@googlegroups.com

No worries!

I was not aware that version was even available given the lack of updates to the GitHub and plugin page. I did however build and install v0.3 of the nodejs-plugin and that appeared to solve the problem (using NodeJS 6.3.1).

Is there anything in particular that keeps this plugin from being updated by the Plugin Manager? The POM has the updated version number (0.3-SNAPSHOT):

<artifactId>nodejs</artifactId>
<version>0.3-SNAPSHOT</version>

I can still go ahead and close this out since this is resolved with the update, though I may create another issue for making sure said plugin can get updated automatically for other users.

leandro.freitas@softdevelop.com.br (JIRA)

unread,
Aug 6, 2016, 2:51:01 AM8/6/16
to jenkinsc...@googlegroups.com

signusx7@gmail.com (JIRA)

unread,
Aug 24, 2016, 3:23:01 PM8/24/16
to jenkinsc...@googlegroups.com
Matthew Sexton closed an issue as Won't Do
 

Closing due to it not being a issue with Jenkins itself, but that the NodeJS plugin has a newer version that is not automatically upgraded by the plugin manager, requiring a manual build of the plugin.

Change By: Matthew Sexton
Status: Open Closed
Resolution: Won't Do

sw@tritum.de (JIRA)

unread,
Jan 27, 2017, 10:57:05 AM1/27/17
to jenkinsc...@googlegroups.com
Sebastian Wagner commented on Bug JENKINS-34815
 
Re: NodeJS plugin unable to install global NPM packages

With current docker jenkins:2.32.1-alpine and plugin nodejs:1.0 this happens again, when using node 7.4:
Alpine just can't run the binary even if it is found in PATH and is executable:

+ /var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs7/bin/node -v

/var/jenkins_home/jobs/busx1/workspace@tmp/durable-a76d6fd5/script.sh: line 1: /var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs7/bin/node: not found

script returned exit code 127

Unpacking https://nodejs.org/dist/v7.4.0/node-v7.4.0-linux-x64.tar.gz to /var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs7 on Jenkins
This happens because the image doesn't contain libstdc++.so.6 as needed by nodejs:

        /lib64/ld-linux-x86-64.so.2 (0x55ae0ad53000)
        libdl.so.2 => /lib64/ld-linux-x86-64.so.2 (0x55ae0ad53000)
        librt.so.1 => /lib64/ld-linux-x86-64.so.2 (0x55ae0ad53000)
Error loading shared library libstdc++.so.6: No such file or directory (needed by /var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs7/bin/node)
        libm.so.6 => /lib64/ld-linux-x86-64.so.2 (0x55ae0ad53000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7f0ac773e000)
        libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x55ae0ad53000)
        libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x55ae0ad53000)
Reply all
Reply to author
Forward
0 new messages