I tried to install newman globally but no luck and here is what I did:
First I installed newman as follows:
Then I ran the command newman -h
in another command prompt window:
'newman' is not recognized as an internal or external command, operable program or batch file.
I looked for the newman module in the following folders but I didn't find any:
C:\Users\my-username\AppData\Roaming\npm\node_modules
C:\Users\my-username\AppData\Roaming\npm
C:\Program Files\nodejs\node_modules\npm\node_modules
Any idea on how to solve this issue?
CodePudding user response:
Cause:
After spending some time trying to solve this, I found out that npm is not configured correctly, and it installs the module in another directory.
Solution:
Make sure that npm prefix is set to the path where NodeJs is installed using the following command:
npm config get prefix
In my case, I already installed NodeJS before running npm install -g newman
in the following path:
So what I did to solve the issue, is to run the following command:
npm config set prefix "C:\Program Files\nodejs"
and then I re-installed Newman globally with npm install -g npm
and that's all.