I'm doing API with the node and using Mongoose. When I give a yarn dev
to start my Nodemon, there is an error in Mongo, I have no idea how to solve this. Would anyone have any ideas? (I'm using the MongoDB Atlas database)
Right after the following error.
yarn run v1.22.5
$ nodemon src/server.js
[nodemon] 2.0.7
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node src/server.js`
(node:752) Warning: Accessing non-existent property 'MongoError' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:752) DeprecationWarning: Listening to events on the Db class has been deprecated and will be removed in the next major version.
I'm using the
My package.json
{
"name": "backend",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"dev": "nodemon src/server.js"
},
"dependencies": {
"express": "^4.17.1",
"md5": "^2.3.0",
"mongoose": "^5.11.16",
"multer": "^1.4.2",
"yarn": "^1.22.10"
},
"devDependencies": {
"nodemon": "^2.0.7"
}
}
Just found this, warning can be ignored it will be fixed in the coming updates
Hi All,
Thanks for reporting! I hit the issue myself today while I was working. I checked in with the Node driver team. The warning is safe to ignore and will hopefully be gone in an upcoming release.
https://developer.mongodb.com/community/forums/t/warning-accessing-non-existent-property-mongoerror-of-module-exports-inside-circular-dependency/15411/6
Same issue here but =>
npm install [email protected]
fix the error message.
Don't forget to check the package.json if it automatically changed it to 5.11.15, if not => type it manually.
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