MongoError: failed to connect to server [localhost:27017] on first connect

Update 2020 Feb 24:

It would be wise to stay tuned with it. Here is the link for latest library instruction:

You haven’t started your monogo database. first install mongo install mongo as per your OS

then follow instructions mentioned on this site:

  1. cd .
  2. mongod –dbpath “any directory path to start your database “

and then start your node server. It will work fine.

Hope this helps!!

Leave a Comment