❯ yarn dev
yarn run v1.22.21
$ node ./src/main.js
file:///P:/Xiying/node_modules/koishi/lib/index.mjs:2
import Loader from "@koishijs/loader";
^^^^^^
SyntaxError: The requested module '@koishijs/loader' does not provide an export named 'default'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:132:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:214:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
at async loadESM (node:internal/process/esm_loader:34:7)
at async handleMainPromise (node:internal/modules/run_main:113:12)
Node.js v20.10.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Steps to reproduce
./src/main.js代码:
import { Context } from "koishi";
import * as echo from "@koishijs/plugin-echo";
import console from "@koishijs/plugin-console";
import * as sandbox from "@koishijs/plugin-sandbox";
const app = new Context({
port: 6200,
});
app.plugin(console);
app.plugin(sandbox);
app.plugin(echo);
app.start();
Describe the bug
运行时出现以下错误:
Steps to reproduce
./src/main.js代码:
Expected behavior
正常运行并出现
6200
端口Screenshots
No response
Versions
Additional context
package.json
文件内容: