当我运行 nodemon 服务器时,我收到错误“bad auth Authentication failed. [nodemon] app crashed - waiting for file cha
Posted
技术标签:
【中文标题】当我运行 nodemon 服务器时,我收到错误“bad auth Authentication failed. [nodemon] app crashed - waiting for file changes before start...”【英文标题】:When I run nodemon server I get the error "bad auth Authentication failed. [nodemon] app crashed - waiting for file changes before starting..." 【发布时间】: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 错误。你能检查一下用户名和密码是否正确吗? 【参考方案1】:在您的 /config/default.json 或 /config/production.json 中有一个对象 mongoURI。
将 url 替换为 用户密码和用户名 而不是您当前有效的帐户名和帐户密码。
您可能已经删除了该用户或更改了密码。
我也尝试在我的本地机器上启动,它没有任何问题。
【讨论】:
谢谢!绝对的救命稻草——当我准备生产代码时,我一定在某个时候覆盖了该代码。以上是关于当我运行 nodemon 服务器时,我收到错误“bad auth Authentication failed. [nodemon] app crashed - waiting for file cha的主要内容,如果未能解决你的问题,请参考以下文章
如何修复 Nodemon “async remove ” 语法错误?
错误:使用带有 babel 7 的 nodemon 时监听 EADDRINUSE
参考错误:当我尝试通过 nodemon myWebJs.js 运行时未定义 $ ...一切都在浏览器上正常工作..只是节点不工作