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

NodeJS plugin attempts to unlink /usr/bin/npm; there is no way to set the auto-refresh to 'never'

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • nodejs-plugin
    • None
    • Ubuntu 14.04

      I installed the NodeJS plugin and set up a few installations.
      In my NodeJS 0.10.33 installation, I set it to globally npm@latest and grunt-cli
      This worked great for 72 hours, then broke all our builds when it attempted to refresh, not the instances under $JENKINS_HOME/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/NodeJS_0.10.33_npm_latest/bin/npm, but /usr/bin:

      {{"/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/NodeJS_0.10.33_npm_latest/bin/npm" "install" "-g" "npm@latest" "grunt-cli"
      npm ERR! node v0.10.33
      npm ERR! npm v2.12.0
      npm ERR! path /usr/bin/grunt
      npm ERR! code EACCES
      npm ERR! errno 3

      npm ERR! Error: EACCES, unlink '/usr/bin/grunt'
      npm ERR!

      { [Error: EACCES, unlink '/usr/bin/grunt'] errno: 3, code: 'EACCES', path: '/usr/bin/grunt' }

      npm ERR!
      npm ERR! Please try running this command again as root/Administrator.

      /var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/NodeJS_0.10.33_npm_latest/bin/npm install -g npm@latest
      npm ERR! Linux 3.13.0-46-generic
      npm ERR! argv "node" "/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/NodeJS_0.10.33_npm_latest/bin/npm" "install" "-g" "npm@latest"
      npm ERR! node v0.10.33
      npm ERR! npm v2.12.0
      npm ERR! path /usr/bin/npm
      npm ERR! code EACCES
      npm ERR! errno 3

      npm ERR! Error: EACCES, unlink '/usr/bin/npm'
      npm ERR!

      { [Error: EACCES, unlink '/usr/bin/npm'] errno: 3, code: 'EACCES', path: '/usr/bin/npm' }

      }}

          [JENKINS-29172] NodeJS plugin attempts to unlink /usr/bin/npm; there is no way to set the auto-refresh to 'never'

          M Chon added a comment - - edited

          I was able to trick the plugin by removing 'npm@latest' from list of global installs.
          Then, even when I select my npm installation, it utilizes what is already installed there i.e. npm@2.12 – without attempting to refresh the one in /usr/bin.

          $ /bin/bash -xe /tmp/hudson6506774195427586284.sh
          + which node
          /var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/NodeJS_0.10.33_npm_latest/bin/node
          + which npm
          /var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/NodeJS_0.10.33_npm_latest/bin/npm
          + which grunt
          /usr/bin/grunt
          + node --version
          v0.10.33
          + npm --version
          2.12.0
          + grunt --version
          grunt-cli v0.1.13
          Finished: SUCCESS

          M Chon added a comment - - edited I was able to trick the plugin by removing 'npm@latest' from list of global installs. Then, even when I select my npm installation, it utilizes what is already installed there i.e. npm@2.12 – without attempting to refresh the one in /usr/bin. $ /bin/bash -xe /tmp/hudson6506774195427586284.sh + which node /var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/NodeJS_0.10.33_npm_latest/bin/node + which npm /var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/NodeJS_0.10.33_npm_latest/bin/npm + which grunt /usr/bin/grunt + node --version v0.10.33 + npm --version 2.12.0 + grunt --version grunt-cli v0.1.13 Finished: SUCCESS

          Nikolas Falco added a comment -

          You have a nodejs installed in the system. When you launch a build after 72 hours it run again the npm command to update global packages. Instead to run the npm in the Jenkins tools folder it run the system nodejs updating wrong installation.

          Use last release please to fix this issue.

          Nikolas Falco added a comment - You have a nodejs installed in the system. When you launch a build after 72 hours it run again the npm command to update global packages. Instead to run the npm in the Jenkins tools folder it run the system nodejs updating wrong installation. Use last release please to fix this issue.

            Unassigned Unassigned
            mcsf M Chon
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: