As the title says i cant connect to the mlab DB
my setup is looking like this:
const mongoose = require(‘mongoose’);
mongoose.connect(process.env.MONGO_URI);
and my MONGO_URI string = MONGO_URI=mongodb://username:password@ds257372.mlab.com:57372/dbname
and in the logs i’m seeing these errors:
ode v8.11.4, with pnpm
Installing…
Resolving: total 79, reused 79, downloaded 0
Resolving: total 79, reused 79, downloaded 0, done
Total install time: 3295ms
(node:987) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
Your app is listening on port 3000
(node:987) UnhandledPromiseRejectionWarning: MongoError: Authentication failed.
at /rbd/pnpm-volume/b8186aec-8a36-4d1b-9ba0-c1c3b5dab7c9/node_modules/.registry.npmjs.org/mongodb-core/3.1.5/node_modules/mongodb-core/lib/connection/pool.js:581:63
at authenticateStragglers (/rbd/pnpm-volume/b8186aec-8a36-4d1b-9ba0-c1c3b5dab7c9/node_modules/.registry.npmjs.org/mongodb-core/3.1.5/node_modules/mongodb-core/lib/connection/pool.js:504:16)
at Connection.messageHandler (/rbd/pnpm-volume/b8186aec-8a36-4d1b-9ba0-c1c3b5dab7c9/node_modules/.registry.npmjs.org/mongodb-core/3.1.5/node_modules/mongodb-core/lib/connection/pool.js:540:5)
at emitMessageHandler (/rbd/pnpm-volume/b8186aec-8a36-4d1b-9ba0-c1c3b5dab7c9/node_modules/.registry.npmjs.org/mongodb-core/3.1.5/node_modules/mongodb-core/lib/connection/connection.js:310:10)
at Socket.<anonymous> (/rbd/pnpm-volume/b8186aec-8a36-4d1b-9ba0-c1c3b5dab7c9/node_modules/.registry.npmjs.org/mongodb-core/3.1.5/node_modules/mongodb-core/lib/connection/connection.js:453:17)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at TCP.onread (net.js:597:20)
(node:987) 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(). (rejection id: 1)
(node:987) [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.
any help is very welcome!