Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

项目启动时报mongodb错误,请问下是什么原因 #282

Open
j0ck67 opened this issue May 15, 2023 · 3 comments
Open

项目启动时报mongodb错误,请问下是什么原因 #282

j0ck67 opened this issue May 15, 2023 · 3 comments

Comments

@j0ck67
Copy link

j0ck67 commented May 15, 2023

成功监听端口:8001
Error in MongoDb connection: MongoError: failed to connect to server [localhost:27017] on first connect [Error: connect ECONNREFUSED ::1:27017
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) {
name: 'MongoError'
}]

F:\vue-projects\node-elm-master\node_modules\mongodb\lib\mongo_client.js:421
throw err
^
Error [MongoError]: failed to connect to server [localhost:27017] on first connect [Error: connect ECONNREFUSED ::1:27017
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) {
name: 'MongoError'
}]
mongodb(版本6.0.6)已经在本地安装成功并且服务已开启,是还需要再导入下数据吗?

@longmore
Copy link

longmore commented May 15, 2023 via email

@1633869082
Copy link

#283 我也遇到了,花了点时间配置好了,这里是我写的教程

@j0ck67
Copy link
Author

j0ck67 commented Jun 1, 2023

#283 我也遇到了,花了点时间配置好了,这里是我写的教程

测试了好几个mongodb版本都不行,最后发现是localhost导致,将其改成'mongodb://127.0.0.1:27017/elm'就行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants