streamich/memfs

Using createWriteStream does not work as intended

开放

#900 创建于 2023年3月28日

 (3 条评论) (3 个反应) (0 位负责人)TypeScript (147 个派生)github user discovery
buggood first issuehelp wanted

仓库指标

星标
 (2,062 个星标)
PR 合并指标
 (平均合并 4天 8小时) (30 天内合并 8 个 PR)

描述

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

贡献者指南