Why do I get this error. I am on a macbook pro. Working on a project that has a node.js api and mongodb database with mongoose as the ODM and an express server. I have seen this error multiple times, and not sure why this happens. Anyone have an idea? Would love some help.
What I have tried: Uninstall Mongodb, reinstall. Wipe the project files and re clone them. Wipe my Mac ( This worked, but had to do it again when this error came again). Also there is no authentication on this what so ever so it shouldn't be asking for it.
Also I have checked and made sure that my code has no unhandled promises, that I have confirmed.
MongoDB connected
listening on http://localhost:4000
(node:57471) UnhandledPromiseRejectionWarning: MongoError: there are no users authenticated
at Connection.<anonymous> (/Users/chirag/Desktop/labs/shopping-cart-be/node_modules/mongodb/lib/core/connection/pool.js:460:61)
at Connection.emit (events.js:315:20)
at processMessage (/Users/chirag/Desktop/labs/shopping-cart-be/node_modules/mongodb/lib/core/connection/connection.js:368:10)
at Socket.<anonymous> (/Users/chirag/Desktop/labs/shopping-cart-be/node_modules/mongodb/lib/core/connection/connection.js:537:15)
at Socket.emit (events.js:315:20)
at addChunk (_stream_readable.js:295:12)
at readableAddChunk (_stream_readable.js:271:9)
at Socket.Readable.push (_stream_readable.js:212:10)
at TCP.onStreamRead (internal/stream_base_commons.js:186:23)
(node:57471) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:57471) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.