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?
npm bin -g
return? What doesecho $PATH
return? – Harenpm bin -g
returns/Users/davidknowles/npm-global/bin
(not in PATH env variable)
– Cayes/Users/davidknowles/npm-global/bin
to your path, as I said in my answer.npm
is probably installed to another directory. (See which by runningwhich npm
.) – Hareecho $PATH
returns/usr/local/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
– Cayesnpm bin -g
solved it for me That let me know my path with:/Users/MYUSERNAMEHERE/.npm-packages/bin
(not in PATH variable) I opened .zshrc and added this line:export PATH=$PATH:/Users/MYUSERNAMEHERE/.npm-packages/bin
Refresh your .zshrc and live-reload works I am obviously using zsh but you could apply this to bash as well I think problems arise when people install using brew versus manually and that is why the solutions vary with regard to paths as manually and homebrew install to different directories – Pushy