How to Fix Error: listen EADDRINUSE in Node.js
If you are a Node.js developer, you may have encountered the error “Error: listen EADDRINUSE: address already in use”. This error occurs when you try to start a server on a port that is already in use by another process.
Here’s how you can fix this error:
- Identify the process using the port
- Kill the process using the port
- Rerun your Node.js server
You can use the following command to identify the process using the port:
lsof -i :
Replace
Once you have identified the process using the port, you can use the following command to kill the process:
kill -9
Replace
After killing the process using the port, you can now rerun your Node.js server. It should now start without any issues.
By following these steps, you can fix the “Error: listen EADDRINUSE: address already in use” in Node.js and continue developing your applications without any interruptions.
how to do the same on windows os ???
running in terminal but the commands doesnt exist in windows terminal
Thank you
What is the name of the program used for the commands