Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

http-server command not found

I'm trying to run a basic http-server to test out some html files and I keep running into the same error.

I did sudo npm install -g http-server a bunch of times, but each time I try

simple git:(master) http-server

I keep getting this error:

zsh: command not found: http-server

I've tried other variations such as http-server / 8000, I've tried using different command syntax but nothing seems to be working.

my npm version is 5.5.1, my node version is 8.3.0, and my OS is Mac OSX Sierra v10.12.6

Please let me know if you can help or if you see anything I'm doing wrong that I'm just not noticing.

edit: tiny update I was able to get a server going with python but I'd really like to know why this wasn't working.

edit 2: problem solved thanks!

like image 620
Jordan Forbes Avatar asked Oct 20 '17 14:10

Jordan Forbes


2 Answers

npm install http-server -g.

please install http-server globally and there after u can run the command

http-server -o
like image 183
Lijo Avatar answered Oct 06 '22 06:10

Lijo


If you are here because you want to test your Angular PWA project locally you need to install http-server package globally using npm install --global http-server and then only you can run http-server

like image 30
INDRAJITH Avatar answered Oct 06 '22 04:10

INDRAJITH