I would suggest there are three possible problems here.
- Port 80 is already in use.
- You are not running the application as root (you can't bind to ports <1024 if you are not root)
- http-server isn't binding correctly
To check if port 80 is already in use try
netstat -lntu | grep :80
If port 80 is already in use you should see something like
tcp6 0 0 :::80 :::* LISTEN
You will need to close whatever is running on port 80 (apache? nginx?)
To check if you can actually bind to port 80, try running http-server from the console rather than via npm i.e.
sudo http-server -a [my ip address] -p 80 -c-1
If the above works you should be able to run npm as root to start your http-server i.e.
sudo npm start
You may need to remove sudo from your package.json:
"start": "http-server -a [my ip address] -p 8065 -c-1"
We need to make sure that http-server is working correctly on your system. We will test it with w3m a console based web browser.
You may need to install w3m with sudo apt-get install w3m
if you do not have it already.
- create a new directory.
mkdir /tmp/testing
- CD into new dir
cd /tmp/testing
- Start http-server with `http-server . -a localhost -p 1234
- Visit http://localhost:1234 with w3m
w3m http://localhost:1234/
- Start http-server with `http-server . -a localhost -p 80
- Visit http://localhost in a w3m
w3m http://localhost/
does it work?