How to fix Error: EPIPE: broken pipe (write to closed stream) in Node.js | DevErrors