Jenkins script quitting prematurely when using npm install on Windows

穿精又带淫゛_ 提交于 2019-12-03 11:12:09

So it turns out that npm is a batch file, not an executable, so it needs to be invoked using call from the Jenkins script:

call npm install grunt
aqm

i would recommend not using the local grunt / nodejs install, but instead getting jenkins to do this for you!

it's much easier and means there's less coupling to system specific installs and variables.

steps:

a) use nodejs jenkins plugin + get it to install nodejs on machine/grunt-cli -> Jenkins integration with Grunt

b) populate your package.json with any nodejs dependances required, eg grunt/grunt-zip etc

c) when running grunt just do a "npm update" before "grunt" command

that way your not doing explicit npm install, it's all configured from your package.json, and your build scripts will be less brittle, and your developers can use the same steps as the build server, eg "npm update;grunt" locally same as build server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!