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

NodeJS plugin causes sh to fail in a declarative pipline

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • nodejs-plugin
    • None
    • Jenkins 2.47
      NodeJS Plugin 1.1.0

      I have a simple test declarative pipeline like below.

      pipeline {
        agent any
      
        tools {
          jdk 'Java 8 JDK u25'
          maven 'Maven 3.2.3'
          nodejs 'NodeJS 6.9.1'
        }
      
        stages {
          stage('Test') {
            steps {
              sh 'printenv'
              sh 'java -version'
              sh 'mvn --version'
              sh 'npm --version'
            }
          }
        }
      }
      

      If I comment out the nodejs and npm lines everything works as expected. However, when I include the nodejs and npm lines, I get the following error:

      [jenkinsfile-test_master-JTGJ7AHME5RPKMDJQ2JWSQLE3GQU7TWXQ2QD3USIDK5QXIBGNM3A] Running shell script
      nohup: failed to run command ‘sh’: No such file or directory
      

            Unassigned Unassigned
            jeffwilliams Jeff Williams
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: