I'm having a doubt
in The Web Developer Bootcamp course from section 29,304 module
(node:15807) Warning: Accessing non-existent property 'count' of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)
(node:15807) Warning: Accessing non-existent property 'findOne' of module exports inside circular dependency
(node:15807) Warning: Accessing non-existent property 'remove' of module exports inside circular dependency
(node:15807) Warning: Accessing non-existent property 'updateOne' of module exports inside circular dependency
I'm getting the above warnings when I use mongoose. How to clear them?
In my case just running the npm update
did resolve the issue
I suspect you are using the brand new version of node 14, which I came across after an update and found this solution:
https://jira.mongodb.org/browse/NODE-2536
tldr; The new mongodb driver version, which is scheduled for April 28, 2020, is intended to fix this.
Solved my problem:
yarn remove mongoose
or npm uninstall mongoose --save
yarn add mongoose
or npm install mongoose --save
Node.js 14 aims for the better performance and it starts to give up warnings for in-cohesive code such as these found in mongodb's npm package. You will need to wait for developers at mongodb to fix it.
You get this warning because you are most likely using the newest stable release of Node.js. This has been fixed in the next version update to the MongoDB Node.js Driver according to the issue here.
Pending when this is available and when the various libraries dependent on this are updated, the warning is sure to persist.
To see where this warnings are being triggered, run your app with the --trace-warnings
flag.
node --trace-warnings .
It is due to the updated Node v14. Just update your MongoDB and mongoose, you should be fine.
To remove these messages you have to update your mongoose packages you can do it with npm using npm update
as this command updates your packages to the latest version this also updates mongoose to the latest version as mongoose worked on this and released a fix for it in the latest version this will help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With