这类问题会带有如下日志:
[W] market node:internal/modules/cjs/loader:1146
[W] market throw err;
[W] market ^
[W] market
[W] market Error: cannot find module 'C:\Users\**\AppData\RoamingKoishi\Desktop\data\instances\default\.yarn\releases\yarn-4.1.1.cis'
[W] market at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
[W] market at Module._load (node:internal/modules/cjs/loader:984:27)
[W] market at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
[W] market at node:internal/main/run_main_module:28:49 {
[W] market code: 'MODULE_NOT_FOUND',
[W] market requireStack: []
[W] market }
[W] market
[W] market Node.js v20.12.2
解决方法:
- 使用记事本打开实例目录下的
.yarnrc.yml
文件
实例目录的位置:
- 文件内有几行,其中一行是类似如下的内容:
yarnPath: .yarn/releases/yarn-4.1.1.cjs
把这行删掉,然后保存。你的问题已经解决,不需要重启 Koishi,直接重新进行之前的操作即可。