node.js - 在 Jenkins 中运行 grunt 时无法解析的 NodeJS 安装程序

标签 node.js jenkins

我根据这篇文章在 Jenkins 中安装了 nodejs 插件:

https://wiki.jenkins-ci.org/display/JENKINS/NodeJS+Plugin

当我在 Jenkins 中创建一个作业(我运行 grunt --force)并运行它时 我收到以下错误:

FATAL: Unresolvable nodeJS installer for version=0.11.13, platform=WINDOWS, cpu=i386
java.lang.IllegalArgumentException: Unresolvable nodeJS installer for version=0.11.13, platform=WINDOWS, cpu=i386
    at jenkins.plugins.nodejs.tools.pathresolvers.LatestInstallerPathResolver.resolvePathFor(LatestInstallerPathResolver.java:28)
    at jenkins.plugins.nodejs.tools.NodeJSInstaller.createDownloadUrl(NodeJSInstaller.java:198)
    at jenkins.plugins.nodejs.tools.NodeJSInstaller.performInstallation(NodeJSInstaller.java:129)
    at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:61)
    at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:107)
    at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:205)
    at jenkins.plugins.nodejs.tools.NodeJSInstallation.forNode(NodeJSInstallation.java:60)
    at jenkins.plugins.nodejs.tools.NpmPackagesBuildWrapper$2.launch(NpmPackagesBuildWrapper.java:68)
    at hudson.Launcher$ProcStarter.start(Launcher.java:360)
    at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:97)
    at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:772)
    at hudson.model.Build$BuildExecution.build(Build.java:199)
    at hudson.model.Build$BuildExecution.doRun(Build.java:160)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:535)
    at hudson.model.Run.execute(Run.java:1732)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:234)

哪里可以找到解决方案?

最佳答案

我明白了:

  1. 在 ManageJenkins -> 配置系统 -> NodeJS(NodeJS 安装)中 必须输入 NodeJs 可执行文件的路径,例如“C:\Program Files\nodejs”

  2. 在 Jenkins 作业中,您必须选中“将 Node & npm bin/文件夹提供到 PATH”并选择 你的nodeJs

  3. 在“构建”部分添加新的“执行 Windows 批处理命令”并输入 grunt.cmd 的路径

关于node.js - 在 Jenkins 中运行 grunt 时无法解析的 NodeJS 安装程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24431349/

相关文章:

javascript - 在 CommonJS 模块中引入 jQuery 的更好方法?

python-3.x - 如何通过本地 Docker 容器中的 python 应用程序从云存储桶中读取文件

node.js - 使用socket.io中的socket.id断开客户端的套接字

node.js - Nodejs + Aerospike 崩溃

node.js - mongo $push 覆盖而不是添加到文档中的数组

java - Jenkins 将构建参数传递给 email-ext 模板

git - Jenkins 电子邮件扩展插件电子邮件通知的收件人是什么?

svn - 在 jenkins 结帐期间排除目录

jenkins - 如何调试Jenkins插件

node.js - 从抓取的网页中获取页面标题