Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not able to run globally installed node packages

I have nodejs in my system. And I installed "http-server" globally using npm( npm install -g http-server). After installing http-server I tried to run http-server, but it is showing "'http-server' is not recognized as an internal or external command, operable program or batch file."

I have added "%AppData%\Roaming\npm;" in NODE_PATH and "C:\Program Files\nodejs\;/usr/local/share/npm/bin/;" in PATH. But still I have the same issue.

Can anyone help me on this.

like image 609
Anna Avatar asked Dec 11 '25 04:12

Anna


1 Answers

Open command prompt and do following :

  1. npm config get prefix And append the output of above command to PATH for example:

o/p C:\Users\username\AppData\Roaming\npm

  1. Do as set PATH=%PATH%;C:\Users\username\AppData\Roaming\npm
like image 126
Himanshu Shekhar Avatar answered Dec 13 '25 22:12

Himanshu Shekhar



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!