title: Jenkins build step fails when calling "npm" on mac-os-x Yosemite
body: <p>Before I start, I want to say that I already checked these answers:</p>
  
  <p><a href="https://stackoverflow.com/questions/11564508/jenkins-build-step-fails-on-npm-install-whatever">Jenkins build step fails on &#39;npm install &lt;whatever&gt;&#39;</a></p>
  
  <p><a href="https://stackoverflow.com/questions/27661573/jenkins-build-failing-on-npm-install">Jenkin&#39;s build failing on npm install</a></p>
  
  <p>Now, I'm dealing with this issue for a while already and thus I tried a bunch of stuff.</p>
  
  <p>Firstly, I installed node + npm via homebrew. A simple <code>$ node -v</code> and <code>$ npm -v</code> echoed the version v0.10.36 for node and v2.3.* for npm, which also means I HAVE THEM IN THE PATH and they work while called in the terminal. </p>
  
  <p>Simply adding <code>node -v; npm -v</code> to the <strong><em>execute shell</em></strong> in Jenkins didn't do it. After a bit of tinkering I copied what <code>$: which node</code> yielded in the terminal to the above mentioned script, which now looked like this: <code>/usr/local/bin/node</code> and apparently that worked. The Jenkins build succeeded and 'node-v0.10.36' was proudly displayed in the <strong><em>console output</em></strong>. </p>
  
  <p>When doing the same for 'npm' which happened to be <code>/usr/local/bin/npm --version</code> the computing gods weren't so merciful anymore. A big '<strong>env: node: No such file or directory</strong>' error was thrown this time and the whole build failed.</p>
  
  <p>The actual command that fails is 
  <code>$ /bin/sh -xe /var/folders/wr/g_dl81tn5_x0t_yz3jw602cr0000gn/T/hudson8770480548136671253.sh</code> and "surprisingly" when I run the same command in the terminal it succeeds. </p>
  
  <p>I also uninstalled the homebrew node &amp; npm versions and installed them afterwards via the package manager. Same results.</p>
  
  <p>Ultimately I also did this: <a href="https://gist.github.com/DanHerbert/9520689" rel="noreferrer">https://gist.github.com/DanHerbert/9520689</a>, with no luck.</p>
  
  <p><strong>Notes:</strong> </p>
  
  <ul>
  <li>I'm running Jenkins 1.613 and tried with 1.5**</li>
  <li>I didn't create a "Jenkins" specific user but instead I'm using the admin. This happens to be the same user that Jenkins runs, since the <code>who am i</code> command inside the executable script yields the admin's user name. </li>
  <li>sudo'ing doens't help</li>
  <li>I'm also running the whole thing in a Virtual Environment - vagrant</li>
  <li>I'm not running Jenkins as a deamon, as it's conflicting with xtools, but as a simple process</li>
  <li>I also tried out jenkins-node plugin with various configs (can detail if needed)</li>
  </ul>
  
  <p>Thanks a lot for your help, and let me know if you need any other info, screenshots, logs, etc.</p>