(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