Node.js - events.js:154 throw err write EPIPE; Program Crashing

后端 未结 3 2210
后悔当初
后悔当初 2020-12-18 06:18

Trying to run my Node.js program, which has worked for a long time, and now it is suddenly... not. I\'m trying to figure out the problem, and I figured it would be helpful i

相关标签:
3条回答
  • 2020-12-18 06:53

    In my case, the issue was with the number of inotify watchers as discussed in this question

    And here is the original listen documentation

    echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
    
    0 讨论(0)
  • 2020-12-18 06:58

    Installing libfontconfig might solve the issue. I got the same issue when I was trying to download PDF from the server. And libfontconfig solved the problem.

    sudo apt-get install libfontconfig
    

    Note: Solution source -> Error: write EPIPE

    0 讨论(0)
  • 2020-12-18 07:09

    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);
        }
    });
    
    0 讨论(0)
提交回复
热议问题