サーバーに node.js をインストールしましたが、動作しています。しかし、しばらくすると次のエラーで停止します。
events.js:77
throw er; // Unhandled 'error' event
^
Error: Connection lost: The server closed the connection.
at Protocol.end (/var/www/node/node_modules/mysql/lib/protocol/Protocol.js:73:13)
at Socket.onend (stream.js:79:10)
at Socket.EventEmitter.emit (events.js:122:20)
at _stream_readable.js:910:16
at process._tickCallback (node.js:373:11)
error: Forever detected script exited with code: 8
error: Forever restarting script for 14 time
、およびを使用してポート8000
でnode.js を実行します。socket.io
node-mysql
mc
へのファイル パスevents.js
は/node/lib/events.js
.
使用forever
すると、連続して実行できますが、それでもエラーが発生します。スクリプトを再起動するだけです。最善の解決策ではありません (何もないよりはましですが、最悪の解決策かもしれません)。
試してみますuncaughtException
が、まだ最善の解決策ではありません。このコード:
process.on('uncaughtException', function (err) {
console.log('Caught exception: ' + err);
});
できれば助けてください。ありがとう。