Reputation: 101
While working with node.js as a beginner, I was facing a trouble with the code i've made for displaying the different parts of my url on the localhost:8080. Check the code mentioned below, correct me if any error is found:- code of the node.js file
Corresponding to the above mentioned code i was getting this error.
This is not only happening for one code but with every code that i try to make.
Please provide an appropriate solution.
Upvotes: 0
Views: 5340
Reputation: 1
With this command you can see process names with ip and port (linux/ubuntu).
sudo lsof -i -P -n
Then you can kill process with
kill <ip>
Upvotes: 0
Reputation: 4925
The error code EADDRINUSE
indicates that the port you are using for your NodeJS application already is in use. Therefore your NodeJS application can't connect to this port anymore. Close all applications that is using that port or use a port that is not in use.
Check all running node processes by using the command in Windows:
tasklist
And kill the process by using:
taskkill /F /PID <ID of process>
Or kill the entire node.exe
process by using the command:
taskkill /F /IM node.exe
If you are using linux, you can try the following:
ps -ef | grep node
sudo kill -9 <PID>
Upvotes: 6
Reputation: 354
i know this error when the port is already used, try another port or kill the node process
Upvotes: 0