How to Fix the Error: listen EADDRINUSE in Node.js
In this post we will give you information about How to Fix the Error: listen EADDRINUSE in Node.js. Hear we will give you detail about How to Fix the Error: listen EADDRINUSE in Node.jsAnd how to use it also give you demo for it if it is necessary.
we are going to learn about how to solve the Error: listen EADDRINUSE: address already in use in Node.js.
When we run a development server of react or other apps, sometimes we will see the following error in our terminal.
Error: listen EADDRINUSE: address already in use 127.0.0.1:3000 at Server.setupListenHandle [as _listen2] (net.js:1306:16) at listenInCluster (net.js:1354:12) at GetAddrInfoReqWrap.doListen [as callback] (net.js:1493:7) at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:65:10)Emitted 'error' event on Server instance at: at emitErrorNT (net.js:1333:8) at processTicksAndRejections (internal/process/task_queues.js:81:21) { code: 'EADDRINUSE', errno: 'EADDRINUSE', syscall: 'listen', address: '127.0.0.1', port: 3000}
This error tells us, the port number we are trying to run a server is already in use.
To solve this error, we need to close the program that is using this port or try to use a different port.
If you don’t know, which program is using that port then you can use the following command to kill the all node processes currently running.
killall -9 node
Hope this code and post will helped you for implement How to Fix the Error: listen EADDRINUSE in Node.js. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs