0

I was trying to connect the MongoDB atlas using mongoose but this is the error I'm getting.

[nodemon] starting `node app.js`
node:events:505
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE: address already in use :::3000
    at Server.setupListenHandle [as _listen2] (node:net:1372:16)
    at listenInCluster (node:net:1420:12)
    at Server.listen (node:net:1508:7)
    at Function.listen (E:\S and P Global Notes_lect\Nodetest\node_modules\express\lib\application.js:635:24)
    at E:\S and P Global Notes_lect\Nodetest\app.js:11:97
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Emitted 'error' event on Server instance at:
    at emitErrorNT (node:net:1399:8)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  code: 'EADDRINUSE',
  errno: -4091,
  syscall: 'listen',
  address: '::',
  port: 3000
}
[nodemon] app crashed - waiting for file changes before starting...

First I thought the error was in the password encoding but I solved it then I got this one

TBA
  • 1,921
  • 4
  • 13
  • 26
YASH MORE
  • 9
  • 2
  • Does this answer your question? [Node / Express: EADDRINUSE, Address already in use - Kill server](https://stackoverflow.com/questions/4075287/node-express-eaddrinuse-address-already-in-use-kill-server) – jabaa May 30 '22 at 20:50

1 Answers1

0

You are most likely already running the server in the same port (3000).

  1. Check your processes and terminate the other instance of the node app that is listening on 3000
  2. Check your network to see if port 3000 is already in use by another application

or

Change the port of your node app to listen to another unused port and the error should go away.

Haris Bouchlis
  • 2,366
  • 1
  • 20
  • 35