我在Windows Server 2012 R2 Standard上设置了Jenkins构建版。构建的一部分包括使用NPM从安装的package.json:Jenkins构建于Windows Server 2012由于node-gyp而失败,从命令行运行
的package.json
{
"name": "localtest",
"version": "1.0.0",
"description": "",
"main": "index.js",
"directories": {
"test": "test"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": url_for_git_repo
},
"author": "",
"license": "ISC",
"devDependencies": {
"extract-text-webpack-plugin": "^0.8.2",
"jasmine-core": "^2.3.4",
"karma": "^0.13.9",
"karma-chrome-launcher": "^0.2.0",
"karma-jasmine": "^0.3.6",
"karma-mocha-reporter": "^1.1.1",
"karma-phantomjs-launcher": "^0.2.1",
"karma-sourcemap-loader": "^0.3.5",
"karma-webpack": "^1.7.0",
"node-sass": "^3.3.1",
"phantomjs": "^1.9.18",
"raw-loader": "^0.5.1",
"sass-loader": "^2.0.1",
"webpack": "^1.12.0"
}
}
当我从它的工作原理成功运行命令行npm install
但是当詹金斯建立它的尝试失败。完整的Jenkins输出可以在pastebin上查看。具体的错误似乎是LINK : fatal error LNK1181: cannot open input file 'C:\Windows\system32\config\systemprofile\.node-gyp\0.12.7\Release\node.lib' [C:\bld\localtest\node_modules\karma\node_modules\socket.io\node_modules\engine.io\node_modules\ws\node_modules\utf-8-validate\build\validation.vcxproj]
。文件夹Release
实际上并不存在于我的系统中,因此除了安装程序已成功从命令行(cmd.exe和git bash FWIW)成功完成之外,它似乎是一个明智的错误消息。
从命令行工作我认为问题是关系到一些环境变量或其他,或者可能是与路径的东西,但试图复制从命令行路径到Jenkins构建我还没有任何喜悦。有没有人有任何建议,我可能会尝试下一步?
更新1:
我刚刚设置的詹金斯服务我的帐户登录,而不是系统帐户并重新启动它。构建成功完成。我认为这更可能是这是环境变量的问题。
更新2:
我安装了Environment Injector插件詹金斯这样我就可以更新它是我的用户和系统用户之间不同的环境变量。这仍然导致相同的错误。