javascript - 从 Cloud Function 中的 firebase 存储下载时出错
问题描述
我有以下代码可以从 Firebase 存储中下载 .txt 文件:
const objectName = `${isla}/${localidad}/${zona}/map.txt`;
const file = storage.bucket(config["storageBucket"]).file(objectName);
const tmpFilePath = path.join(os.tmpdir(), "map.txt");
await file.download({destination: tmpFilePath});
但它会引发错误:
Error: _read() is not implemented at Duplex.Readable._read
(_stream_readable.js:551:22) at Duplex.Readable.read
(_stream_readable.js:442:10) at resume_ (_stream_readable.js:822:12) at
_combinedTickCallback (internal/process/next_tick.js:139:11) at
process._tickDomainCallback (internal/process/next_tick.js:219:9)
我以前使用过这种方法没有问题,不确定我做错了什么,因为我没有尝试设置流。任何帮助表示赞赏,谢谢。
解决方案
正如@bob2 提到的,这是一个已知的错误。
该错误中建议的解决方法是:
如果您 rm -rf node_modules package-lock.json 然后再次 npm install ,一切都应该按预期工作。
推荐阅读
- pdf - NetSuite Advanced PDF 条件显示文本
- bitbucket-pipelines - 仅当上一步失败时才表现位桶管道运行另一个步骤
- javascript - 将一行从 jquery 数据表拖到无序列表中
- javascript - 在 React 中反跳 Axios POST 请求
- python - kivy中的音频位置没有变化
- python - discord.py - 猜谜游戏无响应(更新)
- bash - Bash - 如何处理函数中的附加参数?
- android - 通过android中的位置获取每小时英里数
- javascript - 我可以通过 getDisplayMedia 捕获单个 HTML div 吗?
- verilog - 输入作为输出