β

Answer by zangw for Node.js - events.js:154 throw

User zangw - Stack Overflow 294 阅读

Quoting doc

EPIPE : A write on a pipe, socket, or FIFO for which there is no process to read the data. Commonly encountered at the net and http layers, indicative that the remote side of the stream being written to has been closed.

The steam maybe a pipe or socket when the other end has terminated the connection. It's a run-time error; there is nothing you can do but close your end as well.

Please check if there is one big file written or long http package request in your program.

With the following code could make your program exit successfully in this case:

process.stdout.on('error', function( err ) {
    if (err.code == "EPIPE") {
        process.exit(0);
    }
});
作者:User zangw - Stack Overflow
most recent 30 from stackoverflow.com
原文地址:Answer by zangw for Node.js - events.js:154 throw , 感谢原作者分享。

发表评论