nodejs基础开发新建项目出throw new Error('Required MongoStore option `db` missing')
发布于 10 年前 作者 ihqn 12462 次浏览 最后一次编辑是 8 年前

明明都是照着书来写,但是遇到版本的问题真的好多,一路百度过来。在这里卡住了。建立MongoDB数据库链接,老是报错。 package.json也配置了,models文件夹也建立。settings.js也有了。但是还是错。求高人指点…

D:\node\microblog\node_modules\connect-mongo\lib\connect-mongo.js:96 throw new Error(‘Required MongoStore option db missing’); ^ Error: Required MongoStore option db missing at new MongoStore (D:\node\microblog\node_modules\connect-mongo\lib\connect- mongo.js:96:15) at Object.<anonymous> (D:\node\microblog\app.js:33:12) at Module._compile (module.js:456:26) at Object.Module._extensions…js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:906:3

6 回复

为什么没有人回答、、、泪泪泪

调试参数有缺少, 把代码贴了看吧

他这个microblog是有很多地方与现在的有些包版本所不符,建议楼主在社区里搜下 不然,以后楼主更加的郁闷 :)

请问一下这个解决了吗?

@lgyStoic 这个没有解决,但是后面换了个方法来做好像。

回到顶部