node.js - Jenkins build step fails when calling "npm" on mac-os-x Yosemite -
before start, want checked these answers:
jenkins build step fails on 'npm install <whatever>'
jenkin's build failing on npm install
now, i'm dealing issue while , tried bunch of stuff.
firstly, installed node + npm via homebrew. simple $ node -v
, $ npm -v
echoed version v0.10.36 node , v2.3.* npm, means have them in path , work while called in terminal.
simply adding node -v; npm -v
execute shell in jenkins didn't it. after bit of tinkering copied $: node
yielded in terminal above mentioned script, looked this: /usr/local/bin/node
, apparently worked. jenkins build succeeded , 'node-v0.10.36' proudly displayed in console output.
when doing same 'npm' happened /usr/local/bin/npm --version
computing gods weren't merciful anymore. big 'env: node: no such file or directory' error thrown time , whole build failed.
the actual command fails $ /bin/sh -xe /var/folders/wr/g_dl81tn5_x0t_yz3jw602cr0000gn/t/hudson8770480548136671253.sh
, "surprisingly" when run same command in terminal succeeds.
i uninstalled homebrew node & npm versions , installed them afterwards via package manager. same results.
ultimately did this: https://gist.github.com/danherbert/9520689, no luck.
notes:
- i'm running jenkins 1.613 , tried 1.5**
- i didn't create "jenkins" specific user instead i'm using admin. happens same user jenkins runs, since
who i
command inside executable script yields admin's user name. - sudo'ing doens't help
- i'm running whole thing in virtual environment - vagrant
- i'm not running jenkins deamon, it's conflicting xtools, simple process
- i tried out jenkins-node plugin various configs (can detail if needed)
thanks lot help, , let me know if need other info, screenshots, logs, etc.
i found own solution. problem path although visible in shell not exported jenkins job, , so, first workaround, found here, export in actual script so:
but feels hack!
the right , elegant solution use jenkins envinject plugin , export path in added properties content textarea on configuration page, so:
Comments
Post a Comment