【发布时间】:2019-11-07 09:32:21
【问题描述】:
我一直在开发 node.js / react 应用程序,并将其上传到 heroku。大约一个月前它起作用了(本地和heroku)。现在没有了。即使我下载了应用程序的旧提交(确实有效),我在运行 nodemon server 时似乎也遇到了同样的错误。终端会这样做:
TDI-MacBook-Air:udemy-MERN-FromGithub bob$ nodemon server
[nodemon] 1.19.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node server.js`
Server started on Port 5000
bad auth Authentication failed.
[nodemon] app crashed - waiting for file changes before starting...
1. 从我的 Githum https://github.com/PaulAyling/COURSE-MernStackFrontToBack 下载旧的旧提交
2.跑到终端:npm install
3. 在终端 nodemon server 运行(得到与之前相同的错误)。
4.我尝试用postman连接mongo数据库,出现如下错误:
Could not get any response
There was an error connecting to http://localhost:5000/api/posts.
Why this might have happened:
The server couldn't send a response:
Ensure that the backend is working properly
Self-signed SSL certificates are being blocked:
Fix this by turning off 'SSL certificate verification' in Settings > General
Proxy configured incorrectly
Ensure that proxy is configured correctly in Settings > Proxy
Request timeout:
Change request timeout in Settings > General
阅读错误后,我将 SSL 证书验证更改为关闭,但没有解决问题
有相当多的代码 - 不确定最有用的文件是什么 - 但一个月前它确实有效。
完整代码在这里:https://github.com/PaulAyling/COURSE-MernStackFrontToBack
如果您需要特定代码,请告诉我,我会发布。
期待服务器运行。错误是;
TDI-MacBook-Air:udemy-MERN-FromGithub bob$ nodemon server
[nodemon] 1.19.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node server.js`
Server started on Port 5000
bad auth Authentication failed.
[nodemon] app crashed - waiting for file changes before starting...
【问题讨论】:
-
我认为这是 mongodb 错误。你能检查一下用户名和密码是否正确吗?
标签: javascript node.js mongodb port nodemon