【发布时间】:2018-10-09 05:45:06
【问题描述】:
这是我的第一个 Jenkins 流水线项目。我创建了一个简单的 Node.js 应用程序,并上传到了 hithub(公共 repo),我想要用我的 Jenkinsfile 做的只是在我的Build 阶段“npm install”。我相信詹金斯正在找到Jenkinsfile,但它只是没有找到npm。我正在使用 jenkins 官方 docker 映像来运行我的 jenkins 服务器。这是我安装的两个插件
1) NodeJS Plugin and 2) Pipeline NPM Integration Plugin
这是文件
pipeline {
agent any
stages {
stage ("Build") {
steps {
sh "npm install"
}
}
}
}
这是我运行“立即构建”时遇到的错误 【第二个项目】运行shell脚本 + npm 安装
/var/jenkins_home/workspace/second project@tmp/durable-ef33ffd4/script.sh: 2: /var/jenkins_home/workspace/second project@tmp/durable-ef33ffd4/script.sh:
npm:未找到
有人可以帮忙吗?
【问题讨论】:
标签: node.js jenkins jenkins-pipeline