NPM live-server: command not found

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

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..


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


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

npm install -g live-server