NodeJS Express App在一段时间后崩溃。我开始使用npm start
,启动脚本为
start: "node app.js"
误差
at Socket.emit (events.js:400:28)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
errno: -104,
code: 'ECONNRESET',
syscall: 'read',
fatal: true
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! xxx@1.0.0 start: `node app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the xxx@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
当服务器启动几个小时时会发生这种情况。我想一直保持下去,直到我强制停止。
我也尝试了nodemon app.js
但是因为你也在寻找一种检查错误和潜在调试问题的方法,你应该看看"如何在NodeJS中调试套接字挂起错误?"这是张贴在stackoverflow上的一个类似的问题。