希望这是一个新手问题。 我正在尝试从Windows上的MeteorJs应用程序连接到外部MongoDB数据库。但是,我收到“身份验证失败”错误。我已经使用powershell设置了Env:MONGO_URL,然后在命令提示符下运行meteor命令。但是我可以使用客户端工具(Studio 3T)连接到相同的数据库
$Env:MONGO_URL='mongodb://<userId>:<password>@<host>/<databaseName>'
我想念什么?
堆栈跟踪:
W20190915-18:32:25.554(-5)? (STDERR) C:\Users\AjitGoel\AppData\Local\.meteor\packages\meteor-tool\1.8.1\mt-os.windows.x86_64\dev_bundle\server-lib\node_modules\fibers\future.js:313
W20190915-18:32:25.557(-5)? (STDERR) throw(ex);
W20190915-18:32:25.560(-5)? (STDERR) ^
W20190915-18:32:25.564(-5)? (STDERR)
W20190915-18:32:25.569(-5)? (STDERR) MongoError: Authentication failed.
W20190915-18:32:25.571(-5)? (STDERR) at C:\Users\AjitGoel\AppData\Local\.meteor\packages\npm-mongo\3.1.2\npm\node_modules\mongodb-core\lib\connection\pool.js:581:63
W20190915-18:32:25.574(-5)? (STDERR) at authenticateStragglers (C:\Users\AjitGoel\AppData\Local\.meteor\packages\npm-mongo\3.1.2\npm\node_modules\mongodb-core\lib\connection\pool.js:504:16)
W20190915-18:32:25.578(-5)? (STDERR) at Connection.messageHandler (C:\Users\AjitGoel\AppData\Local\.meteor\packages\npm-mongo\3.1.2\npm\node_modules\mongodb-core\lib\connection\pool.js:540:5)
W20190915-18:32:25.580(-5)? (STDERR) at emitMessageHandler (C:\Users\AjitGoel\AppData\Local\.meteor\packages\npm-mongo\3.1.2\npm\node_modules\mongodb-core\lib\connection\connection.js:310:10)
W20190915-18:32:25.584(-5)? (STDERR) at Socket.<anonymous> (C:\Users\AjitGoel\AppData\Local\.meteor\packages\npm-mongo\3.1.2\npm\node_modules\mongodb-core\lib\connection\connection.js:453:17)
W20190915-18:32:25.588(-5)? (STDERR) at emitOne (events.js:116:13)
W20190915-18:32:25.590(-5)? (STDERR) at Socket.emit (events.js:211:7)
W20190915-18:32:25.594(-5)? (STDERR) at addChunk (_stream_readable.js:263:12)
W20190915-18:32:25.598(-5)? (STDERR) at readableAddChunk (_stream_readable.js:250:11)
W20190915-18:32:25.600(-5)? (STDERR) at Socket.Readable.push (_stream_readable.js:208:10)
W20190915-18:32:25.602(-5)? (STDERR) at TCP.onread (net.js:601:20)
=> Exited with code: 1
答案 0 :(得分:0)
通过在“系统变量”下创建一个新的MONGO_URL环境变量,而不是使用Powershell来创建环境变量,我能够使meteorjs应用程序正常工作。