Answer the question
In order to leave comments, you need to log in
How to solve project startup error?
Error when launching www.js
(node:10102) 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.
Redis connected.
Unable to connect to the mongoDb: { MongoError: Authentication failed.
at Function._getError (/var/www/html/languagelab/node_modules/mongoose/node_modules/mongodb-core/lib/auth/scram.js:125:14)
at sendAuthCommand (/var/www/html/languagelab/node_modules/mongoose/node_modules/mongodb-core/lib/auth/scram.js:175:31)
at Connection.messageHandler (/var/www/html/languagelab/node_modules/mongoose/node_modules/mongodb-core/lib/connection/connect.js:334:5)
at emitTwo (events.js:126:13)
at Connection.emit (events.js:214:7)
at processMessage (/var/www/html/languagelab/node_modules/mongoose/node_modules/mongodb-core/lib/connection/connection.js:364:10)
at Socket.<anonymous> (/var/www/html/languagelab/node_modules/mongoose/node_modules/mongodb-core/lib/connection/connection.js:533:15)
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:601:20) name: 'MongoError', [Symbol(mongoErrorContextSymbol)]: {} }
Answer the question
In order to leave comments, you need to log in
write in mongo database connection string
https://stackoverflow.com/a/51182415
If you are using version >= 3.1.0 change you mongo connection file to ->
MongoClient.connect("mongodb://localhost:27017/YourDB", { useNewUrlParser: true })
or your mongoose connection file to ->
mongoose. connect("mongodb://localhost:27017/YourDB", { useNewUrlParser: true });
but here the error "MongoError: Authentication failed." falls out, that is, is the path to the database correctly written? or the username or password does not match
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question