我(和其他许多人一样)正在努力让 Openshift 上的 Jenkins 墨盒与 NPM 很好地配合。按照其他人对 SO 的建议,我已成功导航需要在 Openshift 上进行的 NPM 缓存重定向,如下所述here https://stackoverflow.com/a/26150783/1348379.
我当前在 Jenkins 上运行节点测试的构建脚本如下所示;
npm --version
node --version
echo "Reconfiguring the NPM cache..."
rm -rf app-root/build-dependencies/.npmrc
mkdir -p app-root/build-dependencies/.npmrc
export NPM_CONFIG_USERCONFIG=$OPENSHIFT_HOMEDIR/app-root/build-dependencies/.npmrc
rm -rf app-root/build-dependencies/.npm
mkdir -p app-root/build-dependencies/.npm
npm config set cache app-root/build-dependencies/.npm
echo "Running build..."
cd OceanLifeAPI
npm install
npm test
我遇到的错误有很多,其中有致命一击;
make: *** [Release/obj.target/protagonist/src/annotation.o] Error 1
make: Leaving directory `/var/lib/openshift/53e7537ee0b8cd3172000dda/app-root/runtime/repo/OceanLifeAPI/node_modules/dredd/node_modules/protagonist/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/var/lib/openshift/53e7537ee0b8cd3172000dda/app-root/data/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/AutoInstaller/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1059:12)
gyp ERR! System Linux 2.6.32-431.29.2.el6.x86_64
gyp ERR! command "node" "/var/lib/openshift/53e7537ee0b8cd3172000dda/app-root/data/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/AutoInstaller/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /var/lib/openshift/53e7537ee0b8cd3172000dda/app-root/runtime/repo/OceanLifeAPI/node_modules/dredd/node_modules/protagonist
gyp ERR! node -v v0.11.14
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
npm ERR! Linux 2.6.32-431.29.2.el6.x86_64
npm ERR! argv "/var/lib/openshift/53e7537ee0b8cd3172000dda/app-root/data/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/AutoInstaller/bin/node" "/var/lib/openshift/53e7537ee0b8cd3172000dda/app-root/data/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/AutoInstaller/bin/npm" "install"
npm ERR! node v0.11.14
npm ERR! npm v2.0.0
npm ERR! code ELIFECYCLE
npm ERR! [email protected] /cdn-cgi/l/email-protection install: `node build.js || nodejs build.js`
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the [email protected] /cdn-cgi/l/email-protection install script.
npm ERR! This is most likely a problem with the sleep package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node build.js || nodejs build.js
npm ERR! You can get their info via:
npm ERR! npm owner ls sleep
npm ERR! There is likely additional logging output above.
Build step 'Execute shell' marked build as failure
Archiving artifacts
Finished: FAILURE
可以查看完整的输出here http://pastebin.com/ddPALWgv.
我可以确认该脚本在运行 npm v1.3.24 和 Node v0.10.25 的本地计算机上运行良好(无需重定向)。 Jenkins 实例正在运行 npm v2.0.0 和节点 v0.11.14。我的下一步是升级本地环境以满足 Jenkins node-npm 配置并尝试在本地复制。也就是说,我仍然不确定应该采取什么纠正措施!
任何建议表示赞赏。
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)