You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import*asfsfrom"fs"// 调用 fs.writeFileSync// 提示: fs.writeFileSync is not a functionimport{Buffer}from'node:buffer'// 提示: The requested module 'node:buffer' does not provide an export named 'Buffer'
detail | 详细描述
Node 版本似乎只支持 CommonJS,不支持 ESM
之前用的 puerts v8 2.1.0 版本 , 逻辑代码用 TypeScript 编写, 所有代码打包成一个 init.mjs 文件。 编译输出为 ESM 格式
可以正常运行。
puerts 版本 切换为 node 2.1.0 , 引入了一些 nodejs 的库后,出现下面的情况:
The text was updated successfully, but these errors were encountered: