Cannot run newman on jenkins [newman :command not found]

Hi all,

Please, I am running into an issue running Newman in Jenkins. I am able to execute my API test on Linux box itself but not on Jenkins. I am getting this error when I try to execute via shell newman: command not found. I also set my environment variables on Jenkins using PATH = /usr/local/bin:$PATH newman -v

Image attached:

  • the test I ran successfully on the box itself
  • Environment variable setup on Jenkins
  • Console output from Jenkins

I really appreciate your help

Thanks

Hi,

Append newman local system foder path before you set configration

e,g,

C:/Users/jkalaria/AppData/Roaming/npm/newman is my local system path than enter run and than your collcetions detail

so “Local newman system path” run “Collection detail”

3 Likes

Hi Team,

I am also getting same error but my Jenkin is in AWS EC2(Linux) , Please help me to resolve this.

In AWS CLI, I have installed node js and newman and could able to run newman commands but when i run same command from Jenkin UI which is present in same AWS EC2, I am getting below error

[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

Please solve this

image

In AWS CLI , i am getting response properly

worked perfectly after giving the full newman path before the collection run command

Worked for me also - Thank you

Thank you very much. It fine after add full path by your advice

Can someone give me the exact Shell command for MAC to fire it off correctly , my builds keeps failing

cd /Users/johanlindstrom/Development/Postman/
cd /Users/johanlindstrom/node_modules/newman

newman run Collection 1.postman_collection.json

I am using Linux container. when I try giving folder path “newman” run XXX.

  • cd /usr/local/bin/node-v12.3.1-linux-x64/lib/node_modules/newman/bin
  • newman run SCTSTSanityTest.postman_collection.json -e StarGate.postman_environment.json -r htmlextra --reporter-htmlextra-export reports/Newman_Test_Execution_Report.html --insecure

/tmp/jenkins153481404085324858.sh: 9: /tmp/jenkins153481404085324858.sh: newman: not found

I am also getting this error, i’m using a aws ec2 as agent but even when add full path it’s not working