-1

I am facing this issue while running nodejs app. I this showing port is already in use error. I have tried a lot to solve this issue by restarting the app.

 Error: listen EADDRINUSE: address already in use :::3000
[Node]     at Server.setupListenHandle [as _listen2] (net.js:1279:14)
[Node]     at listenInCluster (net.js:1327:12)
[Node]     at Server.listen (net.js:1414:7)
[Node]     at Function.listen (C:\Users\nouma\documents\projects\eon_dashboard\node_modules\express\lib\application.js:618:24)
[Node]     at Object.<anonymous> (C:\Users\nouma\documents\projects\eon_dashboard\src\server.ts:36:14)
[Node]     at Generator.next (<anonymous>)
[Node]     at fulfilled (C:\Users\nouma\documents\projects\eon_dashboard\dist\src\server.js:4:58)
[Node] npm ERR! code ELIFECYCLE
[Node] npm ERR! errno 1
[Node] npm ERR! eon_api@0.0.1 serve: `node dist/src/server.js "dist/server.js"`
[Node] npm ERR! Exit status 1
[Node] npm ERR!
npm ERR! Failed at the eon_api@0.0.1 serve script.
  • serve it in another port . somehow this port is in use . if nothing work restart ur pc – sayalok Oct 22 '19 at 19:47
  • 1
    This means there's already a program or service utilizing port 3000. Either change ports or terminate the process on port 3000. If you need help finding the program/service, refer to [this](https://stackoverflow.com/questions/48198/how-can-you-find-out-which-process-is-listening-on-a-port-on-windows) question – gabriel.hayes Oct 22 '19 at 19:48
  • can you add your code for server.js file – Vishnu Oct 22 '19 at 20:38

1 Answers1

0

Might be you are trying to create a server twice in the same project. (happened to me ;-)) or another project is using this port.

my advice is to simply change the port number and restart nodejs.

Mendi Sterenfeld
  • 334
  • 3
  • 18