1
votes

I am getting below error when i try to run from Jenkin shell script

[Collection_run] $ /bin/sh -xe /tmp/jenkins7542658729538318661.sh + newman -version /tmp/jenkins7542658729538318661.sh: line 2: newman: command not found Build step ‘Execute shell’ marked build as failure Finished: FAILURE

Still from AWS EC2 Linux prompt i am getting proper response

Installed below from Command line and set path, From command line things are fine

npm node newman

newman --version

From jenkin i want to run Postman collection as i could able to run from command line

2

2 Answers

0
votes

The PATH variable jenkins uses is probably different than the command line path you set.

To set the PATH variable in Jenkins:

  1. go to Manage Jenkins > Configure System > Global Properties
  2. Check Environment Variables if not already
  3. If PATH is already specified append an entry (: delimiter). If not already specified add an entry with a Name of PATH and Value of $PATH:/your/path/to/newman.
  4. save configuration then restart Jenkins
0
votes

Find This Path and Copy: C:\Users\XXX\AppData\Roaming\npm\node_modules\newman Go To: Control Panel\System and Security\System - Advanced system settings > Environment Variables > System variables > choose the (Path) > Edit > New and paste there:

enter image description here

enter image description here