I am having problems downloading a zip file from the internet. I found countless of examples, but all return the same issue:
I work in NodeJS 12 LTS and Electron 10.
core.js:4197 ERROR Error [ERR_STREAM_CANNOT_PIPE]: Cannot pipe, not readable
at ClientRequest.pipe (_http_outgoing.js:887)
The examples I found are e.g. this one here:
import { request } from 'https';
import * as fs from "fs";
request("https://nodejs.org/dist/v12.18.4/node-v12.18.4-win-x86.zip")
.pipe(fs.createWriteStream('/Users/foo/Desktop/bas.zip'))
.on('close', function () {
console.log('File written!');
});
It couldn't be easier than that, but nonetheless, this fails. The order should be like this (here)
readable.pipe(writable);
This error message doesn't make any sense. What am I missing here?