Answer a question

I'm using newman in Jenkins for executing the postman collection.

A brief background: I have installed node js in C:\Program Files\nodejs and newman was installed using globally so it got installed over here- C:\Users\waniijag\AppData\Roaming\npm\node_modules\newman

About the environment variables:

  1. C:\Users\waniijag\AppData\Roaming\npm got added in the User variables for the user in the Environment variables
  2. Also, I have appended C:\Program Files\nodejs in the Path variable of User variables for user and System variables both.

Now when I'm executing- "newman run Postman collection" OR C:\Users\waniijag\AppData\Roaming\npm\node_modules\newman run postman collection, I'm getting the error as:

'C:\Users\waniijag\AppData\Roaming\npm\node_modules\newman' is not recognized as an internal or external command,
operable program or batch file.

I'm not understanding where I'm going wrong- Thanks in advance.

Answers

enter image description here

add that directory that contains this file, to your environment variable. it will be present in either of:

C:\Users\waniijag\AppData\Roaming\npm\node_modules\.bin

or

C:\Users\waniijag\AppData\Roaming\npm

or directly run it as :

 "C:\Users\someuser\AppData\Roaming\npm\newman" run 

, imagining that newman.cmd is in npm folder , use this command

Logo

CI/CD社区为您提供最前沿的新闻资讯和知识内容

更多推荐