0

I am absolute beginner in Jenkins started learning from yesterday. I went through theory session yesterday that went quit well. However, on when I am trying hands on it I stuck with probably petty issue for Jenkins user.

I am running Jenkins on my mac machine and it's a completely brand new setup

here is the error

+ echo 'build start...'
build start...
[first-job] $ /bin/sh -xe /Users/Shared/Jenkins/tmp/jenkins2233817479314329111.sh
+ npm install
/Users/Shared/Jenkins/tmp/jenkins2233817479314329111.sh: line 2: npm: command not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE

Project config.

enter image description here

Jitender
  • 7,593
  • 30
  • 104
  • 210
  • I have not used Jenkins, but looks like build environment does not have npm installed. Before running `npm install` make sure that `npm` itself is installed and is in your `$PATH` in Jenkins environment – Bishal Nov 18 '18 at 23:39
  • Potentially. How and where to define ```$PATH``` in Jenkins environment – Jitender Nov 18 '18 at 23:42
  • I assume you installed node on your jenkins machine? How did you install it? – Jim B. Nov 19 '18 at 01:02
  • @JimB. I am running jenkins on mac machine and I have install nodejs through ```brew``` command – Jitender Nov 19 '18 at 01:38
  • 1
    If you can run npm in your own account but it doesn't work within Jenkins, it's probably because Jenkins is running your jobs under a different user (jenkins). Brew puts installed files in /usr/local/bin/... Make sure /usr/local/bin is in the path for the jenkins user. – Jim B. Nov 19 '18 at 03:04
  • This may help: https://stackoverflow.com/questions/15620369/jenkins-on-mac-path-is-not-set-right-no-usr-local-bin – Jim B. Nov 19 '18 at 03:06
  • This may help too: https://wiki.jenkins.io/display/JENKINS/NodeJS+Plugin – lvthillo Nov 19 '18 at 12:37

0 Answers0