2-line NodeJS application crashes on mongoose.connect() while trying to connect to a mongolab MongoDB database
问题 I have the following NodeJS code: var mongoose = require('mongoose'); mongoose.connect('mongodb://dev:dev@ds031632.mongolab.com:31632/mongodev'); And upon running it with node server.js , it hangs up for a few seconds and throws the following: C:\Users\dev\work\code\local\nodejsplayground\restwithmongo\nod dules\mongoose\node_modules\mongodb\lib\server.js:228 process.nextTick(function() { throw err; }) ^ Error at Object.<anonymous> (C:\Users\dev\work\code\local\nodejsp round\restwithmongo