MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017 code example
Example: connect ECONNREFUSED 127.0.0.1:27017
For windows - just go to Mongodb folder (ex : C:\ProgramFiles\MongoDB\Server\3.4\bin) and open cmd in the folder and type "mongod.exe --dbpath c:\data\db"
if c:\data\db folder doesn't exist then create it by yourself and run above command again.
All should work fine by now.))
Source stackoverflow