警告:在循环依赖中访问模块导出的不存在的属性"MongoError" [英] Warning: Accessing non-existent property 'MongoError' of module exports inside circular dependency
本文介绍了警告:在循环依赖中访问模块导出的不存在的属性"MongoError"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用该节点的API并使用Mongoose.当我给出 yarn dev
来启动Nodemon时,Mongo中出现错误,我不知道该如何解决.有人有什么想法吗?(我正在使用MongoDB Atlas数据库)
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)
紧接以下错误.
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.
我正在使用
- 节点v14.15.4
- npm 6.14.10
我的package.json
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
大家好,
感谢您的举报!我今天在自己的时候碰到了这个问题在职的.我在Node驱动程序团队中签到.警告是安全的忽略,并希望在即将发布的版本中消失.
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.