会员
周边
新闻
博问
闪存
赞助商
YouClaw
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
huihuistudy
博客园
首页
新随笔
联系
订阅
管理
2024年4月15日
__dirname is not defined in ES model scope
摘要: 出问题的原因是 ESM 中没有全局 __filename 所以需要进行定义 解决方法 import path from 'node:path' import { fileURLToPath } from 'node:url'; const __filename = fileURLToPath(imp
阅读全文
posted @ 2024-04-15 12:04 小辉快快成长
阅读(676)
评论(0)
推荐(0)