Error connecting to MongoDB

1

I try to make a connection to MongoDB using typescript but I get the following error:

    
asked by daniel alfaro 14.11.2018 в 04:18
source

1 answer

1

If you read the message that "EADDRINUSE ::: 4000" is telling you that you already have port 4000 occupied by another application.

What may be happening to you is that you have finished mongo or nodejs and it has not really died and therefore has the port taken.

You can see if the port is taken with the following command

windows

    netstat -na | find "4000"

Linux

    netstat -na | grep 4000

In the result if the port appears, it will tell you in what state it is. I think that in linux with the lsof command you can know who is using it.

If you are in windows you can go to the task manager and kill the process.

    
answered by 14.11.2018 / 09:08
source