简体   繁体   English

nodemon 应用程序崩溃 - 在开始之前等待文件更改......无论如何如何让它重新启动?

[英]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.

相关问题 当我运行 nodemon 服务器时,我收到错误消息“错误的身份验证失败。[nodemon] 应用程序崩溃 - 在开始之前等待文件更改......” - When I run nodemon server I get the error "bad auth Authentication failed. [nodemon] app crashed - waiting for file changes before starting..." React js - nodemon:应用程序崩溃 - 在启动之前等待文件更改 - React js - nodemon: app crashed - waiting for file changes before starting nodejs:nodemon应用程序崩溃-在启动前等待文件更改 - nodejs : nodemon app crashed - waiting for file changes before starting mondoDB 的 Nodemon 错误:“应用程序崩溃 - 启动前等待文件更改” - Nodemon error with mondoDB: “ app crashed - waiting for file changes before starting” nodemon 应用程序崩溃 - 在开始之前等待文件更改? - nodemon app crashed - waiting for file changes before starting? “ [nodemon]应用程序崩溃-等待文件更改,然后再开始...” - '[nodemon] app crashed - waiting for file changes before starting…' nodemon,应用程序崩溃,在启动前等待文件更改 - nodemon , app crashed , waiting for file changes before starting nodemon_app 崩溃 - 在开始之前等待文件更改 - nodemon_app crashed - waiting for file changes before starting nodemon 应用程序崩溃 - 在从服务器获得响应后开始错误之前等待文件更改 - nodemon app crashed - waiting for file changes before starting error after geting response from server 节点 js 错误:[nodemon] 应用程序崩溃 - 启动前等待文件更改 - Node js error: [nodemon] app crashed - waiting for file changes before starting
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM