5

I have installed the latest version of Newman (3.10.0) in my 64-Bit Win 10 Machine.

C:\Users\ABC>npm install -g newman
C:\Users\ABC\AppData\Roaming\npm\newman -> C:\Users\ABC\AppData\Roaming\npm\node_modules\newman\bin\newman.js
+ newman@3.10.0
added 195 packages in 57.852s

However, I am not able to use the newman and I am getting below error while accessing.

C:\Users\ABC>newman -h
'newman' is not recognized as an internal or external command,
operable program or batch file.

I have added an environment variable for the NODE_PATH pointing to the newman directory C:\Users\ABC\AppData\Roaming\npm\node_modules\newman

but no luck. Could some one please help.

Rakesh133
  • 351
  • 1
  • 5
  • 16

4 Answers4

6

Adding in the Path variable under Environment Variable solve the problem even if we don't add in NODE_PATH

C:\Users\ yourusername \AppData\Roaming\npm

After doing this reopen command prompt

enter image description here

enter image description here

enter image description here

Gaurav Khurana
  • 3,423
  • 2
  • 29
  • 38
1

The issue was fixed after troubleshooting with the Node Application. A previous version of Node (32-bit) was installed in my machine and it was not completely removed after I did an uninstall. When I installed Node 64-Bit both entry was present in the environment variable and caused a conflict.

When I manually deleted both installation folder and the env variable the newman worked correcly.

Rakesh133
  • 351
  • 1
  • 5
  • 16
1

I have installed node, vc redist and newman once (on clear windows 7 64 bit) and the issue is looks like related to wrong newman installation. Both newman and node should be installed from administrator session (not just with admin privileges). I have installed newman from regular user, system path setting are correct, but user environment was not set:

path=C:\Users\gagarin\AppData\Roaming\npm

So I have copied

C:\Users\<regular_user>\AppData\Roaming\npm

to C:\Users\admin\AppData\Roaming\npm and run C:\Users\admin\AppData\Roaming\npm\newman.cmd from administrator session. After that newman command became work in admin session. Sadly it works in regular user session only if I type full path to newman like

Blockquote

c:> C:\Users\admin\AppData\Roaming\npm\newman run ....

uBaH
  • 169
  • 1
  • 12
0

I was also getting the same error and I have followed the below steps to troubleshoot it- 1. Know what user is running jenkins, a simple way is Create a jenkins job and in its Build section run the command whoami 2. If it shows System user, then do the following- 2.a. Set C:\Users\I823285\AppData\Roaming\npm and C:\Users\I823285\AppData\Roaming\npm\node_modules\newman\bin in SYSTEM ENV. VARIABLES. b. Restart Jenkins by running CMD as ADMIN, and go to Jenkins installation folder, then enter jenkins.exe restart. c. Re-build the project SUCCESSFUL!

ishaj
  • 91
  • 1
  • 4