Jenkins - 在构建期间,Windows 10上的节点JS + GitHub集成失败

rse*_*esh 11 continuous-integration github node.js jenkins jenkins-plugins

我正在尝试使用Jenkins 1.6版为节点js配置继续集成

第1步:通过保持全局配置,我已按如下方式配置NodeJS安装

全局配置

第2步:我的作业配置选择节点全局配置在这里

工作配置

第3步:我的作业控制台,在安装npm时获取正确的git repo失败 工作控制台

 > C:\Git\Git\bin\git.exe config core.sparsecheckout # timeout=10
 > C:\Git\Git\bin\git.exe checkout -f f1612bda9378e7f03738d142a5ce7c0d0a55f6c3
 > C:\Git\Git\bin\git.exe rev-list f1612bda9378e7f03738d142a5ce7c0d0a55f6c3 # timeout=10
Unpacking https://nodejs.org/dist/v6.9.0/node-v6.9.0-win-x86.zip to C:\Users\Selva\.jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\node_v6.9 on Jenkins
[substack] $ C:\Users\Selva\.jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\node_v6.9\node.exe C:\Users\Selva\AppData\Local\Temp\hudson640278178448032292.js
C:\Users\Selva\AppData\Local\Temp\hudson640278178448032292.js:1
(function (exports, require, module, __filename, __dirname) { npm install
                                                                  ^^^^^^^
SyntaxError: Unexpected identifier
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3
Build step 'Execute NodeJS script' marked build as failure
Finished: FAILURE
    enter code here
Run Code Online (Sandbox Code Playgroud)

如果我需要更改哪个步骤有任何错误,我使用Windows 10机器与jenkins稳定版本

在这里,我遵循官方詹金斯维基页面的文档. Node JS插件

有没有人请帮助解决这个Node JS + Github + Jenkins配置

Dan*_*.G. 18

在步骤2中,您不应该npm install作为Execute NodeJS脚本类型的步骤运行.

  • 这希望你输入有效的节点JavaScript作为脚本,例如console.log('I should be valid javascript code').

离开提供节点和NPM斌/文件夹路径标记和更换执行脚本的NodeJS带有台阶的Windows PowerShell在其中输入脚本npm install脚本值.