node.js - Jenkins "Provide Node & npm bin/folder to PATH"为空

标签 node.js linux jenkins continuous-integration

我已经安装了 Jenkins,添加了我的 repo,还安装了 NodeJS 插件。 但是在 Build Environment > Provide Node & npm bin/文件夹到 PATH 我的下拉菜单是空的。

Image

(二手https://strongloop.com/strongblog/roll-your-own-node-js-ci-server-with-jenkins-part-2/教程) 结果 Jenkins 粉碎了

ERROR: Build step failed with exception
java.lang.IllegalArgumentException: NodeJS Installation not found : 
    at jenkins.plugins.nodejs.NodeJSPlugin.findInstallationByName(NodeJSPlugin.java:42)
    at jenkins.plugins.nodejs.tools.NpmPackagesBuildWrapper$2.launch(NpmPackagesBuildWrapper.java:64)
    at hudson.Launcher$ProcStarter.start(Launcher.java:381)
    at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:95)
    at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:64)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
    at hudson.model.Build$BuildExecution.build(Build.java:205)
    at hudson.model.Build$BuildExecution.doRun(Build.java:162)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
    at hudson.model.Run.execute(Run.java:1720)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:404)
Build step 'Execute shell' marked build as failure
Finished: FAILURE 

那么,怎么了?

最佳答案

您可以在“管理 Jenkins”->“全局工具配置”->“添加 NodeJS”下指定一个新的 Node 安装。

关于node.js - Jenkins "Provide Node & npm bin/folder to PATH"为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39106274/

相关文章:

javascript - npm 编译错误 ('_' 未定义)

node.js - Node 客户端 session 与快速 session

c - 学习如何使用 GNU Autotools 打包我的程序时遇到问题

linux - 授予非root用户kubernetes中kubectl的访问权限

jenkins - 使用包含 Jenkins 表达式和环境变量

jenkins - 如何以编程方式列出 jenkins 作业脚本路径

sockets - 安装 Node http代理

javascript - ejs从文件加载模板

linux - 循环遍历 num_machines 在下面的脚本中,表达式 num_machines=X 中的值每次都会改变

git - Jenkins + Tomcat + Git + SSH 设置