We waste a large amount of time to wait every single jenkins job installing it’s npm dependencies. This is awful to watch and it takes precious time that should rather be spent running the build.
The basic idea is to create a jenkins job to pre-build node_modules.
And execute shell at last:
Now we have a prebuild node_modules tar package in remote folder. Everytime we trigger build, just copy tar file, untar file. npm install will recognise it and ignore the remote fetching.