(node:6584) Warning: Accessing non-existent property ‘count‘ of module exports inside circular depen


1.问题场景

在 node@14.16.1 下使用第三方模块 mongoose@5.4.0 链接数据库mongoDB,出现如下warning

(node:6584) Warning: Accessing non-existent property 'count' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:6584) Warning: Accessing non-existent property 'findOne' of module exports inside circular dependency
(node:6584) Warning: Accessing non-existent property 'remove' of module exports inside circular dependency
(node:6584) Warning: Accessing non-existent property 'updateOne' of module exports inside circular dependency


2. 解决方案

不知道为什么报错, 应该是版本不兼容,卸载旧版本 mongoose 重新下载高版本 npm i mongoose@6.0.4,数据库即可链接成功.


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM