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

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

问题描述

我有一个使用配置的 jenkins 服务器

当管道到达脚本 sh "npm install" 我正在运行这个错误

这是命令 echo $PATH 的输出

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

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

更多可能有帮助的信息:

  • Docker Jenkins 服务器:FROM jenkins/jenkins:2.131-alpine
  • 蓝海版:1.7.0
  • NodeJS 插件:1.2.6
  • 多个服务器已重启

知道为什么 jenkins 服务器不知道节点在哪里吗?

提前致谢!

解决方案

感谢@JoergS 提供一些见解!这种情况的罪魁祸首是:使用 alpine 镜像作为 docker 基础.所以从 jenkins/jenkins:2.131-alpine 切换到 jenkins/jenkins:2.131 解决了 NodeJS 插件问题.

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 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"
      }
    }
  }
}

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

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

this is the output of the command 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 server: FROM jenkins/jenkins:2.131-alpine
  • Blue ocean version: 1.7.0
  • NodeJS Plugin: 1.2.6
  • Multiple server restarts already

Any ideas why the jenkins server does not know where node is?

Big thanks in advance!

解决方案

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天全站免登陆