Jenkins-env:"node":没有这样的文件或目录 [英] Jenkins - env: ‘node’: No such file or directory

查看:556
本文介绍了Jenkins-env:"node":没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用以下配置的jenkins服务器 https://github.com/shierro/jenkins- docker-examples/tree/master/05-aws-ecs

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

我正在使用简单的Jenkinsfile和 jenkins NodeJS插件

I am running a blue ocean pipeline using a simple Jenkinsfile and the jenkins NodeJS plugin

pipeline { 
  agent any 

  tools {
    nodejs 'node10'
  }

  stages {
    stage ('Checkout Code') {
      steps {
        checkout scm
      }
    }
    stage ('Install dependencies') {
      steps {
        sh "echo $PATH"
        sh "npm install"
      }
    }
  }
}

我确保还要添加 node10 全局工具,并且上面已使用w/c

I made sure to add the node10 global tool as well w/c is used above

当管道到达脚本sh "npm install"时,我正在运行此错误

When the pipeline gets to the script sh "npm install" i am running through this error

这是命令echo $PATH的输出

所以我认为这不是路径问题

so i think it's not a path issue

此外,它也无法添加全局包

Also, it also wasn't able to add the global package

更多信息可能会有所帮助:

More info that might help:

  • Docker Jenkins服务器:FROM jenkins/jenkins:2.131-alpine
  • 蓝海版本:1.7.0
  • NodeJS插件:1.2.6
  • 多个服务器已经重新启动
  • Docker Jenkins server: FROM jenkins/jenkins:2.131-alpine
  • Blue ocean version: 1.7.0
  • NodeJS Plugin: 1.2.6
  • Multiple server restarts already

任何想法,为什么jenkins服务器不知道节点在哪里?

预先感谢!

推荐答案

感谢@JoergS的帮助!在这种情况下,罪魁祸首是:使用高山图像作为码头工人基地.因此,从jenkins/jenkins:2.131-alpine切换到jenkins/jenkins:2.131解决了NodeJS插件问题.

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.

这篇关于Jenkins-env:"node":没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆