zoukankan      html  css  js  c++  java
  • nodejs mongoose连接mongodb报错,command find requires authentication

    MongoError: command find requires authentication
        at Connection.<anonymous> (/home/Map/node_modules/mongodb-core/lib/connection/pool.js:443:61)
        at Connection.emit (events.js:310:20)
        at processMessage (/home/Map/node_modules/mongodb-core/lib/connection/connection.js:364:10)
        at Socket.<anonymous> (/home/Map/node_modules/mongodb-core/lib/connection/connection.js:533:15)
        at Socket.emit (events.js:310:20)
        at addChunk (_stream_readable.js:286:12)
        at readableAddChunk (_stream_readable.js:268:9)
        at Socket.Readable.push (_stream_readable.js:209:10)
        at TCP.onStreamRead (internal/stream_base_commons.js:186:23) {
      ok: 0,
      errmsg: 'command find requires authentication',
      code: 13,
      codeName: 'Unauthorized',
      operationTime: Timestamp { _bsontype: 'Timestamp', low_: 13, high_: 1617034825 },
      '$clusterTime': {
        clusterTime: Timestamp { _bsontype: 'Timestamp', low_: 13, high_: 1617034825 },
        signature: { hash: [Binary], keyId: [Long] }
      },
      [Symbol(mongoErrorContextSymbol)]: {}
    }
    

     问题:mongoose版本太高了,,在package.json中,将版本改为 

       "mongoose": "^5.9.7",重新npm i即可
  • 相关阅读:
    软件开发目录规范
    编译Python文件
    python文件的两种用途
    函数高级实战之ATM和购物车系统升级
    函数高级小结
    SpringCloud---(4)Eureka与Zookeeper的区别
    Maven父工程(统一管理依赖)
    SpringCloud-----(1)微服务基础概念
    传统项目架构图
    Session
  • 原文地址:https://www.cnblogs.com/qiyc/p/14596676.html
Copyright © 2011-2022 走看看