UnhandledPromiseRejectionWarning: MongooseServerSelectionError

后端 未结 3 576
梦谈多话
梦谈多话 2020-11-28 16:23

I am following these tutorials as I wanted to start with MongoDB and the MERN stack:

  • https://medium.com/@beaucarnes/learn-the-mern-stack-by-building-an-exercis
3条回答
  •  囚心锁ツ
    2020-11-28 17:09

    I understood you error as I also faced it will trying to connect to mongoDB.

    This error is simply popping up because your mongoDB local server failed to connect to remote server probably because you don't shut down the file correctly.

    How to fix:

    1. Go to cmd prompt and change dir to mongo bin file like this (c:\program files\mongodb\server\4.2\bin).
    2. Now type mongo and hit enter, you will see error not able to connect to mongodb server.
    3. Now go to task manager.
    4. Go to services tab.
    5. Find mongodb and select it.
    6. Now open the open service tab at bottom of same screen.
    7. Again search for mongodb server and select it.
    8. Now click the green play button saying start service.

    That's it , your mongodb server is running again. You can check again in cmd prompt by typing same command.

提交回复
热议问题