1

I tried to install newman globally but no luck and here is what I did: First I installed newman as follows: image.png Then I ran the command newman -h in another command prompt window: image.png

'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?

Machavity
  • 30,841
  • 27
  • 92
  • 100
CryptoBird
  • 508
  • 1
  • 5
  • 22

2 Answers2

1

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

enter image description here

In my case, I already installed NodeJS before running npm install -g newman in the following path:

enter image description here

So what I did to solve the issue, is to run the following command:

npm config set prefix "C:\Program Files\nodejs"

enter image description here

and then I re-installed Newman globally with npm install -g npm and that's all.

enter image description here

CryptoBird
  • 508
  • 1
  • 5
  • 22
0

In the existing answer https://stackoverflow.com/a/71785032/7733418 , the last command for installing Newman should be
npm install -g newman, instead of
npm install -g npm.

Yunnosch
  • 26,130
  • 9
  • 42
  • 54
slopez314
  • 1
  • 1
  • 2
    Are you commenting on a mistake in the existing answer? Or are you saying thanks for the existing answer? Or is this meant to be an answer according to [answer]? – Yunnosch Sep 20 '22 at 08:55
  • Please don't add "thank you" as an answer. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation), you will be able to [vote up questions and answers](https://stackoverflow.com/help/privileges/vote-up) that you found helpful. - [From Review](/review/late-answers/32759980) – dad Sep 25 '22 at 18:00
  • The solution works but the last command is a mistake. So I corrected the mistake, and I did it politely. – slopez314 Sep 25 '22 at 20:30
  • Please [edit] and propose this as a solution in a standalone answer. Feel free to explain which disadvantage the other solution has. Consider that it might be correct in a different context or environment. For now I clarified your reference (hope I got it right). – Yunnosch Oct 04 '22 at 23:30