错误:无法连接到[localhost:27017]

时间:2015-08-30 10:45:19

标签: javascript node.js mono localhost

当我运行node app.js时,我收到以下错误:

Failed to load c++ bson extension, using pure JS version
Express server listening on port 3000
events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: failed to connect to [localhost:27017]
    at null.<anonymous> (/Users/me/development/node_modules/mongodb/lib/mongodb/connection/server.js:553:74)
    at emit (events.js:118:17)
    at null.<anonymous> (/Users/me/development/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:140:15)
    at emit (events.js:110:17)
    at Socket.<anonymous> (/Users/me/developmen/node_modules/mongodb/lib/mongodb/connection/connection.js:512:10)
    at Socket.emit (events.js:107:17)
    at net.js:451:14
    at process._tickCallback (node.js:355:11)

我不确定这是本地主机问题还是与mongodb连接的问题。我试着查看类似的问题SO和Github,但它没有帮助我。

1 个答案:

答案 0 :(得分:1)

好像mongodb服务器没有运行。检查