Closed Innei closed 2 years ago
Log:
$ koishi start -- -r esbuild-register
[I] app Koishi/4.5.1
[I] app apply plugin ./src/ping
[I] app apply plugin console
[E] app TypeError: Cannot read properties of undefined (reading 'global')
at new HttpService (/Users/xiaoxun/github/innei-repo/koishi-app/node_modules/.pnpm/@koishijs+plugin-console@2.1.0_koishi@4.1.2/node_modules/@koishijs/plugin-console/src/http.ts:16:17)
at callback (/Users/xiaoxun/github/innei-repo/koishi-app/node_modules/.pnpm/@koishijs+core@4.5.1/node_modules/@koishijs/core/src/context.ts:309:26)
at _Context.plugin (/Users/xiaoxun/github/innei-repo/koishi-app/node_modules/.pnpm/@koishijs+core@4.5.1/node_modules/@koishijs/core/src/context.ts:318:5)
at new Console (/Users/xiaoxun/github/innei-repo/koishi-app/node_modules/.pnpm/@koishijs+plugin-console@2.1.0_koishi@4.1.2/node_modules/@koishijs/plugin-console/src/index.ts:35:9)
at callback (/Users/xiaoxun/github/innei-repo/koishi-app/node_modules/.pnpm/@koishijs+core@4.5.1/node_modules/@koishijs/core/src/context.ts:309:26)
at App.plugin (/Users/xiaoxun/github/innei-repo/koishi-app/node_modules/.pnpm/@koishijs+core@4.5.1/node_modules/@koishijs/core/src/context.ts:318:5)
at Loader.reloadPlugin (/Users/xiaoxun/github/innei-repo/koishi-app/node_modules/.pnpm/@koishijs+cli@4.1.2/node_modules/@koishijs/cli/src/loader.ts:145:14)
at Loader.createApp (/Users/xiaoxun/github/innei-repo/koishi-app/node_modules/.pnpm/@koishijs+cli@4.1.2/node_modules/@koishijs/cli/src/loader.ts:155:12)
at Object.<anonymous> (/Users/xiaoxun/github/innei-repo/koishi-app/node_modules/.pnpm/@koishijs+cli@4.1.2/node_modules/@koishijs/cli/src/worker.ts:21:20)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
试一下把版本都更新到最新版,主要是 @koishijs/plugin-console。
可以的,最好还是更新一下模板吧,对模板都跑不动的话挺劝退的
模板其实一直是最新的,是不是你项目比较旧,安装的比较早?
Describe the bug
使用 npm init koishi 的模板无法启动,plugin-console 注册失败,
Cannot read properties of undefined (reading 'global')
Steps to reproduce
使用 脚手架 新建项目,选择 pnpm,esbuild
Expected behavior
正常启动
Screenshots
No response
Versions
Additional context
No response