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 if I posted here to try to track it down. Here's the log output:
events.js:154
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at exports._errnoException (util.js:856:11)
at WriteWrap.afterWrite (net.js:767:14)
Quite frankly I have no clue why it's throwing an EPIPE error, I've checked that there's nothing running that could interfere and it's running in the exact same shell as it has before. If there's anything I should add let me know.
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 if I posted here to try to track it down. Here's the log output:
events.js:154
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at exports._errnoException (util.js:856:11)
at WriteWrap.afterWrite (net.js:767:14)
Quite frankly I have no clue why it's throwing an EPIPE error, I've checked that there's nothing running that could interfere and it's running in the exact same shell as it has before. If there's anything I should add let me know.
Share Improve this question edited Feb 26, 2016 at 1:51 zangw 48.4k23 gold badges206 silver badges241 bronze badges asked Feb 26, 2016 at 0:49 gmemstrgmemstr 1651 gold badge2 silver badges9 bronze badges 1- Related to github.com/npm/npm/issues/11153? – Bergi Commented Feb 26, 2016 at 1:20
2 Answers
Reset to default 9Quoting doc
EPIPE
: A write on a pipe, socket, or FIFO for which there is no process to read the data. Commonly encountered at thenet
andhttp
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);
}
});
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