猿问

mongodb运行报错

D:\test\node-elm-master\node_modules\mongodb\lib\mongo_client.js:421

          throw err

          ^

MongoError: failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]

    at Pool.<anonymous> (D:\学习重地\网上下载的项目\node-elm-master\node_modules\mongodb\node_modules\mongodb-core\lib\topologies\server.js:336:35)

    at emitOne (events.js:96:13)

    at Pool.emit (events.js:188:7)

    at Connection.<anonymous> (D:\学习重地\网上下载的项目\node-elm-master\node_modules\mongodb\node_modules\mongodb-core\lib\connection\pool.js:280:12)

    at Connection.g (events.js:292:16)

    at emitTwo (events.js:106:13)

    at Connection.emit (events.js:191:7)

    at Socket.<anonymous> (D:\学习重地\网上下载的项目\node-elm-master\node_modules\mongodb\node_modules\mongodb-core\lib\connection\connection.js:187:49)

    at Socket.g (events.js:292:16)

    at emitOne (events.js:96:13)

    at Socket.emit (events.js:188:7)

    at emitErrorNT (net.js:1277:8)

    at _combinedTickCallback (internal/process/next_tick.js:80:11)

    at process._tickCallback (internal/process/next_tick.js:104:9)

Program node --harmony index.js exited with code 1


Starting child process with 'node --harmony index.js'


Vol_蒲公英
浏览 2967回答 1
1回答

大咪

你这是用虚拟机自己搭建的mongo吗?如果是的话看看linux的墙有没有关闭
随时随地看视频慕课网APP

相关分类

MongoDB
Node.js
我要回答