【報錯日記】又一個terminal來的mongoose報錯

pei
·
·
IPFS
·

結論:只是因為mongoDB or mongoose版本需要更新。

[nodemon] restarting due to changes...
[nodemon] starting `node app.js`
(node:27776) Warning: Accessing non-existent property 'count' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:27776) Warning: Accessing non-existent property 'findOne' of module exports inside circular dependency
(node:27776) Warning: Accessing non-existent property 'remove' of module exports inside circular dependency
(node:27776) Warning: Accessing non-existent property 'updateOne' of module exports inside circular dependency
Now is listening on localhost:3000
mongodb connected!

丟上google大神後列表第一個就是mongoDB官網的解答,看來是眾生均因此而報錯。解決辦法是更新到mongoDB/mongoose有fix此問題的版本。

官方解答在此。

CC BY-NC-ND 2.0 授权

喜欢我的作品吗?别忘了给予支持与赞赏,让我知道在创作的路上有你陪伴,一起延续这份热忱!