Error code

Node.js ERR_STREAM_DESTROYED

NODE.JSERR_STREAM_DESTROYED
Runtime Error Code· An error code from a programming runtime or package manager, like Node.js or npm.

What it means

An operation was performed on a stream that has already been destroyed.

How to fix it

  1. Check the stream's destroyed property before writing.
  2. Add error and close event handlers to clean up references.
  3. Avoid holding references to streams after they are closed.

Not affiliated with Node.js. Answer summarized from the manufacturer's manual linked above; consult that source for the authoritative procedure.