Jenkins build step fails when calling "npm" on mac-os-x Yosemite Jenkins build step fails when calling "npm" on mac-os-x Yosemite jenkins jenkins

Jenkins build step fails when calling "npm" on mac-os-x Yosemite


I found my own solution. The problem was that the PATH although visible in shell was not exported for the Jenkins job, and so, the first workaround, as found here, was to export it in the actual script like so:

enter image description here

but this feels like a hack!

The right and elegant solution is to use Jenkins EnvInject Plugin and export the path in the added Properties content textarea on the configuration page, like so:

enter image description here