I created expressjs application using the following commands:
express -e folderName
npm install ejs --save
npm install
When I run the appli
None of the answers worked for me.
When I restarted my computer I could get the server up and running.
Mac
shutdown now -r
Linux
sudo shutdown now -r
I had the same problem and I found out, that a nodejs process that I had previously canceled with CTRL+C was still running. The problem in Windows 10 is, that Ctrl + C Doesn't Kill Gracefully nodejs. I opened the task manager and killed the process manually. The solutions provided on GitHub didn't work for me.
IF it is in mac then it's all about IP of x86_64-apple-darwin13.4.0. If you follow errors it would be something related to x86_64-apple-darwin13.4.0. Add
127.0.0.1 x86_64-apple-darwin13.4.0
to /etc/hosts file. Then the problem is gone
You had run another server use the same port like 8080.
Maybe you had run node app
in other shell, Please close it and run again.
You can check PORT no. is available or not using
netstat -tulnp | grep <port no>
Alternatively, you can use lsof:
lsof -i :<port no>
An instance is probably still running. This will fix it.
killall node
Update: This command will only work on Linux/Ubuntu & Mac.
The port you are listening to is already being listened by another process.
When I faced to this error I killed the process using Windows PowerShell (because I used Windows)
ps
and then you can get list of processesStop-process <Id>
I think that it is help for windows users