Jenkins - env: ‘node’: No such file or directory

后端 未结 5 1088
不知归路
不知归路 2021-01-05 02:36

I have a jenkins server that is configured using https://github.com/shierro/jenkins-docker-examples/tree/master/05-aws-ecs

I am running a blue ocean pipeline using a

相关标签:
5条回答
  • 2021-01-05 02:58

    Make a symbolic link like this:

    sudo ln -s /var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/node/bin/node /usr/bin/node

    0 讨论(0)
  • 2021-01-05 02:58

    I want to highlight Mitch Downey's comment, it can't be just a comment because after spending 4 hours with no solution this comment helped me to resolve the solution

    My issue ended up being with the jenkinsci/blueocean image. I was able to just replace that image with jenkins/jenkins:lts and the NodeJS plugin began working as expected

    0 讨论(0)
  • 2021-01-05 03:00

    I have faced the same issue with jenkinsci/blueocean. I have resolved this by installing nodejs with below command(inside docker) not as jenkins plugin

    apk add nodejs

    0 讨论(0)
  • 2021-01-05 03:07

    I have faced the same issue with jenkinsci/blueocean. No jenkins nodejs plugin needed.

    pipeline { 
      agent any 
    
      stages {
        stage ('Checkout Code') {
          steps {
            checkout scm
          }
        }
        stage ('Install dependencies') {
          steps {
            sh "apk add nodejs"
            sh "echo $PATH"
            sh "npm install"
          }
        }
      }
    }
    
    0 讨论(0)
  • 2021-01-05 03:19

    Thanks to @JoergS for some insight! The culprit in this case is: using alpine image as the docker base. So switching from jenkins/jenkins:2.131-alpine to jenkins/jenkins:2.131 solved the NodeJS plugin issue.

    0 讨论(0)
提交回复
热议问题