首页
注册
登录
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请
登录
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
V2EX
›
程序员
web worker 中不能使用 node.js fs.promises?
TomeWong
·
2020-04-29 10:00:16 +08:00
· 1743 次点击
这是一个创建于 1809 天前的主题,其中的信息可能已经有所发展或是发生改变。
在 electron 中使用,发现没法用,调试 fs.promises 是 undefined,但 fs api 文档中是有这个方法的。
是不是不支持这种方式的调用?
第 1 条附言 ·
2020-04-29 10:50:40 +08:00
刚才改了下,在外层加上 async 就可以使用 fs.promises,同时要在 fs.promises 前面加上 await
ises
omis
Worker
undefined
2 条回复
•
2020-04-29 10:49:03 +08:00
1
joe237
2020-04-29 10:23:28 +08:00
确认一下 electron 的版本?看它集成的 node 版本是否与你所看的文档版本一致?
2
TomeWong
OP
2020-04-29 10:49:03 +08:00
@
joe237
好的,谢谢
关于
·
帮助文档
·
博客
·
API
·
FAQ
·
实用小工具
·
2044 人在线
最高记录 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 24ms ·
UTC 00:41
·
PVG 08:41
·
LAX 17:41
·
JFK 20:41
Developed with
CodeLauncher
♥ Do have faith in what you're doing.