scotch-io / node-api

Building a RESTful API Using Node and Express 4
453 stars 322 forks source link

MongoError: auth fails #13

Open mdrijwan opened 7 years ago

mdrijwan commented 7 years ago

can't run node server.js as it gives me the following error.


node-api/node_modules/mongoose/node_modules/mongodb/lib/utils.js:99
    process.nextTick(function() { throw err; });
                                  ^
MongoError: auth fails
    at Function.MongoError.create (/Users/iflix/code/mine/node-api/node_modules/mongoose/node_modules/mongodb-core/lib/error.js:31:11)
    at /Users/iflix/code/mine/node-api/node_modules/mongoose/node_modules/mongodb-core/lib/connection/pool.js:483:72
    at authenticateStragglers (/Users/iflix/code/mine/node-api/node_modules/mongoose/node_modules/mongodb-core/lib/connection/pool.js:429:16)
    at Connection.messageHandler (/Users/iflix/code/mine/node-api/node_modules/mongoose/node_modules/mongodb-core/lib/connection/pool.js:463:5)
    at Socket.<anonymous> (/Users/iflix/code/mine/node-api/node_modules/mongoose/node_modules/mongodb-core/lib/connection/connection.js:309: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:543:20)
anoopk23 commented 7 years ago

edit the line with the version of mongoose with following line: "mongoose" : "~3.6.13", then run from terminal, npm install

helongliang commented 6 years ago

can't run node server.js as it gives me the following error.

Magic happens on port 8080 (node:10048) DeprecationWarning: open() is deprecated in mongoose >= 4.11.0, u se openUri() instead, or set the useMongoClient option if using connect() or createConnection(). See http://mongoosejs.com/docs/connections.html#use-mon go-client connection error: { MongoError: failed to connect to server [novus.modulusmongo. net:27017] on first connect [MongoError: connect ETIMEDOUT 54.209.84.209:27017] at Pool. (E:\work\holon_code\node\node-api\node_modules\mongodb-c ore\lib\topologies\server.js:336:35) at emitOne (events.js:116:13) at Pool.emit (events.js:211:7) at Connection. (E:\work\holon_code\node\node-api\node_modules\mon godb-core\lib\connection\pool.js:280:12) at Object.onceWrapper (events.js:317:30) at emitTwo (events.js:126:13) at Connection.emit (events.js:214:7) at Socket. (E:\work\holon_code\node\node-api\node_modules\mongodb -core\lib\connection\connection.js:187:49) at Object.onceWrapper (events.js:315:30) at emitOne (events.js:116:13) at Socket.emit (events.js:211:7) at emitErrorNT (internal/streams/destroy.js:64:8) at _combinedTickCallback (internal/process/next_tick.js:138:11) at process._tickCallback (internal/process/next_tick.js:180:9) name: 'MongoError', message: 'failed to connect to server [novus.modulusmongo.net:27017] on first connect [MongoError: connect ETIMEDOUT 54.209.84.209:27017]' }