Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm -v. The system cannot find the path specified

Tags:

node.js

npm

I installed node js on windows 7 from https://nodejs.org/en/download/. When I run node -v out put is v8.9.4 But when I check npm -v out put is

The system cannot find the path specified.
5.6.0

In path variable entry is as

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

blank npm folder is present on above path

I added entry in path variable as it is recommended in some answer

C:\Program Files\nodejs

but still getting same error. I tried solutions I found online like above path entry, re installation, global installation of npm but still same error

like image 394
hrishi Avatar asked Dec 18 '25 09:12

hrishi


2 Answers

I found a solution in this article: https://www.thetopsites.net/article/53531888.shtml "I needed to move my node paths further up the list. Windows must have been looking for NPM in the wrong path variable. I moved my node path to the top of the system path variables and now NPM works." It helped me after a day of struggle.

like image 53
Tomas.K. Avatar answered Dec 21 '25 04:12

Tomas.K.


More details for the solution provided by @Thomas.K: Open Windows Settings and search for 'environ' like here:

enter image description here

Make sure to choose the one for "system environment", and in the dialog which appears press this button:

enter image description here

You will get this dialog

enter image description here

There are two PATH declarations, at top and bottom. You will have to remove the npm entry off the upper list, and paste it into the top of the lower list. This should solve the problem of "The system cannot find the path specified".

like image 39
ishahak Avatar answered Dec 21 '25 04:12

ishahak



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!