node.js – ExpressJS – throw er Unhandled error event
node.js – ExpressJS – throw er Unhandled error event
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>
We do get similar error when we sometimes run our express app. We have to follow the same in that case. We need to check if its running in any terminal.
If you want to find and kill process, follow these steps:
- ps aux | grep node
- Find the process ID (second from the left):
- kill -9 PRCOCESS_ID
OR
Use a single command to close all the running node processes.
ps aux | awk /node/{print $2} | xargs kill -9
node.js – ExpressJS – throw er Unhandled error event
An instance is probably still running.
This will fix it.
killall node
Update: This command will only work on Linux/Ubuntu & Mac.
Related posts on node js :
- node.js – How can I execute a bin with yarn?
- node.js – Angular 2 accessing mongoDB data
- node.js – Retries in AWS Lambda
- node.js – npm install from tgz created with npm pack
- node.js – How to install and use semantic-ui-react
- node.js – How to run Mocha tests written in TypeScript?
- javascript – How to tell if node.js is installed or not
- node.js – Express.js req.body undefined