streamich/memfs

Using createWriteStream does not work as intended

Aperta

#900 aperta il 28 mar 2023

 (3 commenti) (3 reazioni) (0 assegnatari)TypeScript (147 fork)github user discovery
buggood first issuehelp wanted

Metriche repository

Star
 (2062 stelle)
Metriche merge PR
 (Merge medio 4g 8h) (8 PR mergiate in 30 g)

Descrizione

I am downloading a file from google drive, which works perfectly with node fs module with this code

const drive = google.drive({ version: "v3", auth }); const dest = fs.createWriteStream("./downloaded.zip");

drive.files.get(
    { fileId: "google-file-id", alt: "media" },
    { responseType: "stream" },
    (err, res) => {
        res?.data.pipe(dest);
    }
);

but when using memfs I am receiving this error

"Error: ENOENT: no such file or directory, open '/home/yory/casino-odr-v2/services/casino-odr-v2/downloaded.zip'\n at createError (/home/yory/casino-odr-v2/node_modules/.pnpm/memfs@3.4.13/node_modules/memfs/lib/volume.js:128:17)\n at Volume.openFile (/home/yory/casino-odr-v2/node_modules/.pnpm/memfs@3.4.13/node_modules/memfs/lib/volume.js:850:23)\n at Volume.openBase (/home/yory/casino-odr-v2/node_modules/.pnpm/memfs@3.4.13/node_modules/memfs/lib/volume.js:861:25)\n at Immediate. (/home/yory/casino-odr-v2/node_modules/.pnpm/memfs@3.4.13/node_modules/memfs/lib/volume.js:698:33)\n at processImmediate (node:internal/timers:471:21)\n at process.callbackTrampoline (node:internal/async_hooks:130:17)"

Guida contributor