MongoNetworkError: failed to connect to server [localhost:27017]

MongoNetworkError: failed to connect to server [localhost:27017] on first connect [MongoNetworkError: connection 0 to localhost:27017 timed out
    at Socket.<anonymous> (D:\Desktop\node\mongodblearn\07_student_list\node_modules\mongodb\lib\core\connection\connection.js:355:7)     
    at Object.onceWrapper (events.js:427:28)
    at Socket.emit (events.js:321:20)
    at Socket._onTimeout (net.js:478:8)
    at listOnTimeout (internal/timers.js:549:17)
    at processTimers (internal/timers.js:492:7) {
  name: 'MongoNetworkError'
}]
    at Pool.<anonymous> (D:\Desktop\node\mongodblearn\07_student_list\node_modules\mongodb\lib\core\topologies\server.js:438:11)
    at Pool.emit (events.js:321:20)
    at D:\Desktop\node\mongodblearn\07_student_list\node_modules\mongodb\lib\core\connection\pool.js:562:14
    at D:\Desktop\node\mongodblearn\07_student_list\node_modules\mongodb\lib\core\connection\pool.js:995:11
    at callback (D:\Desktop\node\mongodblearn\07_student_list\node_modules\mongodb\lib\core\connection\connect.js:97:5)
    at D:\Desktop\node\mongodblearn\07_student_list\node_modules\mongodb\lib\core\connection\connect.js:124:7
    at _callback (D:\Desktop\node\mongodblearn\07_student_list\node_modules\mongodb\lib\core\connection\connect.js:349:5)
    at Connection.errorHandler (D:\Desktop\node\mongodblearn\07_student_list\node_modules\mongodb\lib\core\connection\connect.js:365:5)   
    at Object.onceWrapper (events.js:428:26)
    at Connection.emit (events.js:321:20) {
  name: 'MongoNetworkError'
}

出现如上错误 ,说明Mongodb未启动

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值