I have installed http-server using the following command:
npm i -g http-server
Upon running the server I get the response saying Running o
I'm having the exact same problem. Just installed both node and http-server globally. run http-server and it gives me the following error when accessing localhost:8080:
"ERR_INVALID_REDIRECT"
If I try to access the index.html page, it works. It doesn't even show directories listing, even with -d in the command line.
I got something, though: installing an older version of http-server and it loads the index.html automagically :)
This was the command/version: npm install -g http-server@0.8.5
Anything newer (0.9.0+) and it breaks again.
Edit:
Even then, it will only work on sub-folders, not on the root. For example:
http://localhost:8080/mypage/ will load index.html automatically.
http://localhost:8080/ won't