bangbang93/openbmclapi

Windows Releases 1.10.7 导入 fs-extra 报错

Closed this issue · 1 comments

log

file:///C:/Users/Shan_shanHY/Desktop/openbmclapi-windows/dist/storage/file.storage.js:3
import fse, { mkdirp } from 'fs-extra';
              ^^^^^^
SyntaxError: Named export 'mkdirp' not found. The requested module 'fs-extra' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'fs-extra';
const { mkdirp } = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5)

Node.js v20.13.1

问题位置(1.10.7新增内容)

import fse, {mkdirp} from 'fs-extra'

fixed in 9d12472