我一直试图将我的应用程序上传到Heroku但是我一直收到这个MongoError:身份验证失败错误。我正确地输入了用户名和密码。有人可以帮我吗。我尝试安装不同版本但没用。
正在运行mongod --version
db version v3.4.4
git version: 888390515874a9debd1b6c5d36559ca86b44babd
在我的package.json中我有
"dependencies": {
"mongoose": "^4.4.12",
"mongoose-unique-validator": "^1.0.2"
},
app.js
var mongoose = require('mongoose'); mongoose.connect('<username>:<password>@ds129023.mlab.com:29023/ng2');
heroku logs:-
throw er; // Unhandled 'error' event
MongoError: Authentication failed.
at Function.MongoError.create (/app/node_modules/mongodb-
core/lib/error.js:31:11)
at /app/node_modules/mongodb-core/lib/connection/pool.js:497:72
^
at authenticateStragglers (/app/node_modules/mongodb-
core/lib/connection/pool.js:443:16)
at Connection.messageHandler (/app/node_modules/mongodb-
core/lib/connection/pool.js:477:5)
at Socket.<anonymous> (/app/node_modules/mongodb-
core/lib/connection/connection.js:321:22)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at TCP.onread (net.js:547:20)
由于