我只是想创建一个 API 并在 app.js 文件中连接到它,但每次运行 app.js 时都会收到此弃用警告。我已经检查了 mongoose 和 MongoDB 中的所有弃用警告,但我找不到任何与我的相匹配的警告。我收到的警告是,
(node:16864) Warning: Accessing non-existent property 'MongoError' of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)
(node:16864) DeprecationWarning: Listening to events on the Db class has been deprecated and will be removed in the next major version.
为什么我会收到此弃用警告以及如何删除它?
我猜想 mongoose 5.11.16 版本会出现此警告。如果您想在错误修复之前避免看到它们,您可以选择 mongoose 版本 5.11.15。卸载 mongoose 5.11.16 并安装npm 安装[电子邮件受保护] /cdn-cgi/l/email-protection
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)