Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute npm install in Jenkins only if the package.json has changes

Tags:

maven

jenkins

I am building(mvn) my project using Jenkins. Jenkins configured to run npm install and bower install. So each and every time when I build my project, the npm install will run, so the build time is more every time. So I thought to run npm install only if there is any changes, like new package is added, version changes or anything got removed etc., in package.json. I googled a lot to find out a way to achieve this, but failed.

Is there any plugins which I can use to achieve this?

Can anyone help me to find out a way to do this?

Thanks in advance.

like image 958
Vineeth Koppai Avatar asked Jul 06 '15 08:07

Vineeth Koppai


1 Answers

I had the same problem as you and wrote npm-install-changed.

Install with npm install -g npm-install-changed, and run npm-install-changed instead of the usual npm install. Let me know if it works for you.

like image 130
oNaiPs Avatar answered Sep 27 '22 23:09

oNaiPs