无法读取未定义的属性“ ClientSession”

时间:2019-04-25 04:49:49

标签: node.js mongodb mongoose

由于某些原因,尝试运行节点应用程序时出现clientSession错误。我正在使用node,express,angular和mongo。

有人知道错误并且对我可以看的东西有什么想法吗?

/root/WWW/server/node_modules/mongodb/lib/topologies/topology_base.js:8
  ClientSession = require('mongodb-core').Sessions.ClientSession;
                                                  ^

TypeError: Cannot read property 'ClientSession' of undefined
    at Object.<anonymous> (/root/WWW/server/node_modules/mongodb/lib/topologies/topology_base.js:8:51)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/root/WWW/server/node_modules/mongodb/lib/topologies/mongos.js:3:22)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! server@0.0.0 start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the server@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-04-25T04_38_28_599Z-debug.log
root@synctup-stage:~/WWW/server# 

0 个答案:

没有答案