mean-stack-crud-app icon indicating copy to clipboard operation
mean-stack-crud-app copied to clipboard

MongoNetworkError

Open tmehta2442 opened this issue 5 years ago • 1 comments

Hello There! Running thru your tutorial and getting stuck with a Database could not connected: MongoNetworkError

Here's what I get when I run nodemon server

[nodemon] 2.0.2
[nodemon] to restart at any time, enter `rs`
[nodemon] watching dir(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node server.js`
(node:24188) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
Connected to port 4000
Database could not connected: MongoNetworkError: failed to connect to server [localhost:27017] on first connect [Error: connect ECONNREFUSED 127.0.0.1:27017
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) {
  name: 'MongoNetworkError',
  [Symbol(mongoErrorContextSymbol)]: {}
}]

Any thoughts? Can't seem to get past this! Bet it is something super simple.

tmehta2442 avatar Mar 22 '20 01:03 tmehta2442

The instructions on the website only have you install Mongoose which is an ODM (Object Document Mapper) for MongoDB. You need to actually install MondoDB.

https://stackoverflow.com/questions/50173080/mongonetworkerror-failed-to-connect-to-server-localhost27017-on-first-connec

alexmuch avatar May 15 '20 21:05 alexmuch