streamich/memfs

Using createWriteStream does not work as intended

Ouverte

#900 ouverte le 28 mars 2023

 (3 commentaires) (3 réactions) (0 personne assignée)TypeScript (147 forks)github user discovery
buggood first issuehelp wanted

Métriques du dépôt

Stars
 (2 062 étoiles)
Métriques de merge PR
 (Merge moyen 4j 8h) (8 PRs mergées en 30 j)

Description

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)"

Guide contributeur