0

I have Nodejs and NPM installed on my computer, and i'm trying to install Newman to run my Postman collection, but after writing on my command line "npm install -g newman", i get the following warnings:-

  1. npm WARN deprecated har-validator@5.1.5: this library is no longer supported
  2. npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher
  3. 5 packages are looking for funding run npm fund

Then when i run "newman -v" on my command line, i get eror message "newman' is not recognized as an internal or external command, operable program or batch file". I canät really get to install newman, what could be the issue?

  • What is the operating system you installed on? – Janitha Tennakoon Aug 30 '21 at 08:53
  • @janitha000 it's windows 10 –  Aug 30 '21 at 09:00
  • Check whether C:\Users\{User Name}\AppData\Roaming\npm\newman is available. If so try to run from that location. – Janitha Tennakoon Aug 30 '21 at 09:04
  • @janitha000, yes, newman is available in that location, but when i click "newman - command script", command line appears to open then closes immediately. –  Aug 30 '21 at 09:13
  • Run C:\Users\{User Name}\AppData\Roaming\npm\newman -v – Janitha Tennakoon Aug 30 '21 at 09:20
  • Yes, i did run that way and i get version 5.2.4 –  Aug 30 '21 at 09:28
  • Add C:\Users\{User Name}\AppData\Roaming\npm to your path variables. Open a new terminal afterwards and it should work. https://phoenixnap.com/kb/windows-set-environment-variable – Janitha Tennakoon Aug 30 '21 at 09:31
  • @janitha000, I have created an environment variable named 'Newman' with the path as the value, but just wondering if every time i want run newman, i have to specify the path or just C:\Users\{User Name}\Newman? –  Aug 30 '21 at 09:56
  • Sorry, I posted the wrong link. You don't need to create a new env variable. Just add the C:\Users\{User Name}\AppData\Roaming\npm\ to the existing path variable. You don't need to give the full path afterward. https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/ – Janitha Tennakoon Aug 30 '21 at 10:21

1 Answers1

0

for windows command line :

setx path=C:\Users\{User Name}\AppData\Roaming\npm;%PATH%

this will set the environment variable PATH permanently, just run this in cmd

PDHide
  • 18,113
  • 2
  • 31
  • 46
  • i did wrote as you said, but got "Invalid syntax", type SETX for usage. –  Sep 07 '21 at 06:52
  • @DanAroka are you using windows comandline ? – PDHide Sep 07 '21 at 09:34
  • @DanAroka replace the npm path with the path where your npm is don't reuse the command as it is – PDHide Sep 07 '21 at 12:31
  • i'm not sure i understand what you mean. So i should not use "setx"? My current comand line is as follows:- C:\users\{User Name}\. What should i write after that? –  Sep 07 '21 at 12:47
  • you should find where the module are getting installed and then set it as `setx path=C:\Users\pathto\npm;%PATH%` – PDHide Sep 07 '21 at 12:49