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

后端 未结 1 1343
花落未央
花落未央 2021-02-06 04:22

Before I start, I want to say that I already checked these answers:

Jenkins build step fails on 'npm install '

Jenkin's build failing

相关标签:
1条回答
  • 2021-02-06 04:59

    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

    0 讨论(0)
提交回复
热议问题