在Jenkins中运行grunt时无法解析的nodeJS安装程序 [英] Unresolvable nodeJS installer when run grunt in Jenkins
问题描述
根据这篇文章,我在Jenkins中安装了nodejs插件:
I installed nodejs plugin in Jenkins, based on this article:
https://wiki.jenkins-ci.org/display/JENKINS/NodeJS +插件
当我在詹金斯创建工作时(我运行grunt --force)并运行它 我收到以下错误:
When I create a job in Jenkins (i run grunt --force) and run it i get the following error:
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)
我在哪里可以找到解决方案?
Where can I look for solution?
推荐答案
我知道了:
-
在ManageJenkins->配置系统-> NodeJS(安装NodeJS)中, 必须输入NodeJs可执行文件的路径,例如. "C:\ Program Files \ nodejs"
In ManageJenkins -> Configure System -> NodeJS(NodeJS installation) you have to enter a path to NodeJs executable, eg. "C:\Program Files\nodejs"
在Jenkins作业中,必须选中将Node& npm bin/文件夹提供给PATH",然后选择 您的nodeJs
In your Jenkins job you have to check "Provide Node & npm bin/ folder to PATH" and select your nodeJs
在构建"部分,添加新的"Execute Windows batch command"并输入grunt.cmd的路径
On Build section you add new "Execute Windows batch command" and enter path to grunt.cmd
这篇关于在Jenkins中运行grunt时无法解析的nodeJS安装程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!