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

Incompatibility with EnvInject plugin

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • Ubuntu 14.04
      Jenkins 2.47
      Only needed plugins for Nodejs and EnvInject Plugin 1.93.1

      Hello!

      I just updated our setup to the new 1.1.1 version of the Nodejs Plugin and experienced problems with the EnvInject Plugin. I tracked it down to a change between Version 0.2.2 and 1.0.0 in the Nodejs plugin.

      Steps to reproduce:
      1. Disable all plugins
      2. Install Nodejs and EnvInject Plugin (Environment Inject in the plugin list)
      3. Create a Nodejs configuration that installs an arbitrary version from nodejs.org (e.g. 6.9.3)
      4. Create a test job with nothing enabled but "Provide Node & npm bin/ folder to PATH" with the created nodejs configuration and the system wide npmrc
      5. Add "Execute shell script" with "which node; which npm; node -v; npm -v"

      Even though the EnvInject plugin is only enabled as a plugin, but not configured in the job ("Inject environment variables to the build process" is unticked) the result of the job looks like this:

      [EnvInject] - Loading node environment variables.
      Building in workspace /var/lib/jenkins/jobs/nodejs/workspace
      [workspace] $ /bin/sh -xe /tmp/hudson5471480512323947214.sh
      + which node
      /usr/local/bin/node
      + which npm
      /usr/local/bin/npm
      + node -v
      v6.9.4
      + npm -v
      4.1.2
      Finished: SUCCESS
      

      When I disable the EnvInject plugin in the plugin list the output looks as expected:

      Started by user anonymous
      Building in workspace /var/lib/jenkins/jobs/nodejs/workspace
      [workspace] $ /bin/sh -xe /tmp/hudson2888187863059550468.sh
      + which node
      /var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/node-js-test/bin/node
      + which npm
      /var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/node-js-test/bin/npm
      + node -v
      v6.9.3
      + npm -v
      3.10.10
      Finished: SUCCESS
      

      I hope this problem can be fixed, because both plugins are very important for us.

      Thank you in advance!
      Ben

            oleg_nenashev Oleg Nenashev
            benurb_sz Benjamin Urban
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: