关于新插件的环境好久不更新,一更新炸档解决方案(正在开发的插件迁移到新版本)

  1. 旧版本备份external文件夹,然后双清,装新版本。
  2. 然后把external放到新装的koishi根目录下。
  3. 在根目录跑一次yarn或者npm i

迁移后编译发生问题:

4 个赞

直接运行 yarn 或者 npm i 就可以了啊

2 个赞

我丢人了!

2 个赞

原来还可以这样,我是在n_m里面创建一个文件夹,把external里的一个插件复制进去,好像也没啥问题(

2 个赞

下次 yarn 的时候文件夹会消失,提前做好备份就行

1 个赞

佬救救!

我最近通过使用yarn迁移后,能够在node_modules出现软链接,但是在新的模板项目根目录下执行yarn build了后,external文件夹下所有工作区内都不会出现lib

我是这么做的:

  1. yarn create koishi 新建新版本koishi的模板项目
  2. 然后通过将旧版本的external文件夹剪切黏贴到新的koishi模板项目的根目录下
  3. 在新的模板项目的根目录运行yarn
  4. node_modules文件夹内容:
  5. external文件夹内容:
  6. 插件工作区
  7. 模板项目根目录运行yarn build,似乎build完成后没有消息
  8. 插件工作区内无变化:
2 个赞

更新node版本到20

3 个赞

(好像还是不太行?

现在使用yarn build后依旧没有出现lib文件夹

2 个赞

没能复现)

logs
PS C:\Users\5800h\Desktop\work\temp> yarn create koishi
yarn create v1.22.21
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Installed "create-koishi@6.2.0" with binaries:
      - create-koishi
[##########################] 26/26
  Create Koishi  v6.2.0

√ Project name: ... koishi-temp
  Scaffolding project in koishi-temp ...
  Done.

√ Initialize Git for version control? ... yes
  Done.

√ Install and start it now? ... yes
➤ YN0088: A new stable version of Yarn is available: 4.0.2!
➤ YN0088: Upgrade now by running yarn set version 4.0.2

➤ YN0000: · Yarn 4.0.1
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + @koishijs/client@npm:5.26.6, @koishijs/plugin-actions@npm:0.0.2, and 621 more.
➤ YN0000: └ Completed in 2s 146ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 13 packages were added to the project (+ 8.16 MiB).
➤ YN0000: └ Completed in 0s 548ms
➤ YN0000: ┌ Link step
➤ YN0007: │ esbuild@npm:0.18.20 must be built because it never has been before or the last one failed
➤ YN0007: │ vue-demi@npm:0.14.6 [571a2] must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 4s 576ms
➤ YN0000: · Done in 7s 363ms
2024-01-29 09:01:45 [I] app Koishi/4.16.7
2024-01-29 09:01:45 [I] loader apply plugin group:entry
2024-01-29 09:01:45 [I] loader apply plugin group:server
2024-01-29 09:01:45 [I] loader apply plugin server:m2yvfl
2024-01-29 09:01:45 [I] loader apply plugin group:basic
2024-01-29 09:01:45 [I] loader apply plugin commands:enoe6i
2024-01-29 09:01:45 [I] loader apply plugin help:hcc27l
2024-01-29 09:01:45 [I] loader apply plugin locales:qxx3kp
2024-01-29 09:01:45 [I] loader apply plugin rate-limit:1iz48k
2024-01-29 09:01:45 [I] loader apply plugin telemetry:rfq6oj
2024-01-29 09:01:45 [I] loader apply plugin group:console
2024-01-29 09:01:45 [I] loader apply plugin actions:q72i02
2024-01-29 09:01:45 [I] loader apply plugin analytics:b8raot
2024-01-29 09:01:45 [I] loader apply plugin config:j9zryd
2024-01-29 09:01:45 [I] loader apply plugin console:1vstgj
2024-01-29 09:01:45 [I] loader apply plugin dataview:mz8k86
2024-01-29 09:01:45 [I] loader apply plugin explorer:k3fkmj
2024-01-29 09:01:45 [I] loader apply plugin logger:m5opl2
2024-01-29 09:01:45 [I] loader apply plugin insight:ch3mit
2024-01-29 09:01:45 [I] loader apply plugin market:k799b6
2024-01-29 09:01:45 [I] loader apply plugin notifier:sbrl8t
2024-01-29 09:01:45 [I] loader apply plugin oobe:0iqifw
2024-01-29 09:01:45 [I] loader apply plugin sandbox:578zoz
2024-01-29 09:01:45 [I] loader apply plugin status:tudtuj
2024-01-29 09:01:45 [I] loader apply plugin theme-vanilla:hryoyq
2024-01-29 09:01:45 [I] loader apply plugin group:storage
2024-01-29 09:01:45 [I] loader apply plugin database-sqlite:0vhy6d
2024-01-29 09:01:45 [I] loader apply plugin assets-local:4dq64d
2024-01-29 09:01:45 [I] loader apply plugin group:adapter
2024-01-29 09:01:45 [I] assets missing config "selfUrl", fallback to "file:" scheme
2024-01-29 09:01:45 [I] server server listening at http://127.0.0.1:5141
2024-01-29 09:01:45 [I] console webui is available at http://127.0.0.1:5141
2024-01-29 09:01:45 [I] sqlite auto creating table user
2024-01-29 09:01:45 [I] sqlite auto creating table binding
2024-01-29 09:01:45 [I] sqlite auto creating table channel
2024-01-29 09:01:45 [I] sqlite auto creating table analytics.message
2024-01-29 09:01:45 [I] sqlite auto creating table analytics.command
2024-01-29 09:01:50 [I] app terminated by SIGINT
^C
PS C:\Users\5800h\Desktop\work\temp> cd .\koishi-temp\
PS C:\Users\5800h\Desktop\work\temp\koishi-temp> yarn setup test
√ description: ...
➤ YN0000: · Yarn 4.0.1
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 391ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done in 0s 772ms
PS C:\Users\5800h\Desktop\work\temp\koishi-temp> cd .\external\
PS C:\Users\5800h\Desktop\work\temp\koishi-temp\external> ls


    目录: C:\Users\5800h\Desktop\work\temp\koishi-temp\external


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         2024/1/29      9:02                test


PS C:\Users\5800h\Desktop\work\temp\koishi-temp\external> cd .\test\
PS C:\Users\5800h\Desktop\work\temp\koishi-temp\external\test> ls


    目录: C:\Users\5800h\Desktop\work\temp\koishi-temp\external\test


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         2024/1/29      9:02                src
-a----         2024/1/29      9:01            147 .editorconfig
-a----         2024/1/29      9:01             76 .gitattributes
-a----         2024/1/29      9:01            165 .gitignore
-a----         2024/1/29      9:01             31 .npmignore
-a----         2024/1/29      9:02            311 package.json
-a----         2024/1/29      9:02            150 readme.md
-a----         2024/1/29      9:02            444 tsconfig.json


PS C:\Users\5800h\Desktop\work\temp\koishi-temp\external\test> cd ../../
PS C:\Users\5800h\Desktop\work\temp\koishi-temp> yarn build
TSFILE: C:/Users/5800h/Desktop/work/temp/koishi-temp/external/test/lib/index.js
TSFILE: C:/Users/5800h/Desktop/work/temp/koishi-temp/external/test/lib/index.d.ts
TSFILE: C:/Users/5800h/Desktop/work/temp/koishi-temp/external/test/tsconfig.tsbuildinfo
PS C:\Users\5800h\Desktop\work\temp\koishi-temp> cd .\external\test\
PS C:\Users\5800h\Desktop\work\temp\koishi-temp\external\test> ls


    目录: C:\Users\5800h\Desktop\work\temp\koishi-temp\external\test


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         2024/1/29      9:02                lib
d-----         2024/1/29      9:02                src
-a----         2024/1/29      9:01            147 .editorconfig
-a----         2024/1/29      9:01             76 .gitattributes
-a----         2024/1/29      9:01            165 .gitignore
-a----         2024/1/29      9:01             31 .npmignore
-a----         2024/1/29      9:02            311 package.json
-a----         2024/1/29      9:02            150 readme.md
-a----         2024/1/29      9:02            444 tsconfig.json
-a----         2024/1/29      9:02          27893 tsconfig.tsbuildinfo


PS C:\Users\5800h\Desktop\work\temp\koishi-temp\external\test>
2 个赞

(大型悄悄话现场))))

3 个赞

悄悄话总结:

  • 编译发现没有产物更新请使用 yarn build --clean 来清除旧的构建 map 重新构建
  • 如果是开发环境,只需要移动 external 文件即可;n_m 不需要也不要移动,应当由 yarn 或 npm 等包管理管理
3 个赞

感谢dalao)))解决哩!

5 个赞

为什么我可以看见你们的悄悄话

3 个赞

image

3 个赞

原来活跃用户还有这种特权

3 个赞

怎么你们都是活跃用户

2 个赞