NPM live-server: command not found

Timidfriendly picture Timidfriendly · Feb 20, 2016 · Viewed 26.8k times · Source

I install live-server globally with:

npm install -g live-server but for some reason it is not be found and I get the following error

bash: live-server: command not found after command live-server

Everything is correctly installed:

/Users/username/npm-global/bin/live-server ->
/Users/username/npm-global/lib/node_modules/live-server/live-server.js
[email protected] /Users/username/npm-global/lib/node_modules/live-server
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

What am I missing here?

Answer

bolav picture bolav · Feb 20, 2016

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