a blog for those who code

Saturday 30 July 2016

What is EADDRINUSE Error and how to solve it in Node.js

In this post we will be discussing about what is EADDRINUSE error and how we can solve it. Have you ever seen EADDRINUSE error in node.js ? Almost everyone have seen it. EADDRINUSE error means that the port number where you want to start your server is already in use by other server.

This error is common across other language and framework as well. In android also you get an error as Socket EADDRINUSE (Address already in use). There the error is little more specific as the error itself specifying what the problem is i.e. address already in use.

In Node.js if I try to run server on 8080 and if any application was already running on 8080 then I will get error as (Error: listen EADDRINUSE). If you are not sure that any application is running or not on the specific port than you can check using netstat -an. This will tell you that any process is running on the port (for ex : 8080) or not.

To solve this error either you can start your node server on another port or kill the previous process that is running on port.

Please Like and Share the CodingDefined Blog, if you find it interesting and helpful.

No comments:

Post a Comment