[英]nodemon app crashed - waiting for file changes before starting... HOW TO MAKE IT RESTART ANYWAY?
From time to time it does happen, but restarting the node bypass this.有时它确实会发生,但重新启动节点会绕过它。 I really dont have how to debug and see the actual error and the site needs to be online anyway.
我真的不知道如何调试和查看实际错误,而且网站无论如何都需要在线。
I wish to know a way to restart the server whet this error happens, without having to change a file or anything like that.我想知道一种在发生此错误时重新启动服务器的方法,而不必更改文件或类似的东西。
I know this is a way around, etc etc... but that's what I need to do now...我知道这是一种解决方法,等等……但这就是我现在需要做的……
ERROR:错误:
[nodemon] app crashed - waiting for file changes before starting... [nodemon] 应用程序崩溃 - 在开始之前等待文件更改...
PACKAGE.json PACKAGE.json
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node app.js",
"server": "nodemon app --ignore './client/'",
"client": "npm start --prefix client",
"dev": "concurrently \"npm run server\" \"npm run client\"",
"build": "concurrently \"npm run server\" \"npm run client\""
},
starting using node server.开始使用节点服务器。
This occurred because the process was exited in a non-graceful way.发生这种情况是因为进程以非正常方式退出。 If you want auto-restart after crashing, that's not the purpose of nodemon.
如果你想在崩溃后自动重启,那不是 nodemon 的目的。
I would recommend pm2我会推荐pm2
You could try using forever as advised in the nodemon FAQ .您可以按照 nodemon FAQ 中的建议尝试使用forever 。
forever -c "nodemon --exitcrash" app.js
This way if the script crashes, forever restarts the script, and if there are file changes, nodemon restarts your script.这样,如果脚本崩溃,将永远重新启动脚本,并且如果有文件更改, nodemon 将重新启动您的脚本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.