NPM live-server: command not found

27,165

Solution 1

Add the path to your npm installation to your path. Just add this line at the end of .bash_profile. Run it in bash first, to make sure it works before putting it in .bash_profile

export PATH=$PATH:/Users/username/npm-global/bin

Solution 2

The main problem is that node js does not know the path of the installed modules ..

Type this command to get the path of all the global modules.

npm bin -g

It will display the path (C:\Users\gf\AppData\Roaming\npm) and also show (not in PATH env variable)

Copy the path and add it to the path variable of your computer (just like you do while installing other software) for eg : In Windows 7 - Right click on my computer ->select properties -> select advanced system settings -> environment variables

enter image description here

Double click on the Path variable

enter image description here

In the variable value first type a semicolon and paste the path which you copied and that's it every thing should work now..

Solution 3

In my case (Ubuntu with npm installed from package) live-server module was not installed. It helps:

npm install -g live-server

Solution 4

Just a note, don't just blindly copy and paste the path /Users/username be sure you do the

npm bin -g

as explained by others and get that actual path into export PATH=$PATH:/YourActualPathHERE

Solution 5

try to install as root/Administrator

sudo npm install -g live-server

Hope this will solve your problem.. its works for me...

Share:
27,165
Timidfriendly
Author by

Timidfriendly

Updated on July 30, 2021

Comments