Mongoose Nodejs: error when connecting with Mongodb

Asked

Viewed 311 times

0

I am trying to connect to the Mongodb database but the following error occurs: inserir a descrição da imagem aqui

My code: inserir a descrição da imagem aqui

when I run the mongod server command: inserir a descrição da imagem aqui

If anyone can help me find a solution, I’d be grateful

  • Put your code as text and not as image

1 answer

2


On your app, change the door. The EADDRINUSE error means that your port 8081 is already in use by some other application.

  • I have to put the same port that the mongodb server is using? or any other?

  • 1

    No. You have to use any other door that is free on your machine. Ex: 8080, 3000, 5000 .. and so on..

  • I changed the door here and it worked, thank you very much =D

Browser other questions tagged

You are not signed in. Login or sign up in order to post.