koishijs / koishi

Cross-platform chatbot framework made with love
https://koishi.chat
MIT License
4.53k stars 246 forks source link

Bug: 当默认 `5140` 端口被占用时 Koishi 会重启而不是自增为 `5141` #1242

Closed Lipraty closed 1 year ago

Lipraty commented 1 year ago

Describe the bug

默认 5140 端口被占用后,不会自增为 5141。而是会不断重启。

Steps to reproduce

新建一个 Koishi 之后启动:

> yarn dev
yarn run v1.22.10
$ cross-env NODE_ENV=development koishi start -r esbuild-register -r yml-register
2023-10-26 08:59:22 [I] app Koishi/4.15.2
......
2023-10-26 08:59:24 [I] app server listening at http://127.0.0.1:5140
2023-10-26 08:59:24 [E] app Error: listen EADDRINUSE: address already in use 127.0.0.1:5140
                            at __node_internal_captureLargerStackTrace (node:internal/errors:477:5)
                            at __node_internal_uvExceptionWithHostPort (node:internal/errors:576:12)
                            at Server.setupListenHandle [as _listen2] (node:net:1432:16)
                            at listenInCluster (node:net:1480:12)
                            at doListen (node:net:1629:7)
                            at processTicksAndRejections (node:internal/process/task_queues:84:21)
2023-10-26 08:59:24 [I] app Koishi/4.15.2
2023-10-26 08:59:24 [I] app apply plugin group:entry
......
> ^C

Expected behavior

启动后自增为 5141

Screenshots

image

Versions

Additional context

这一幕似曾相识(

shigma commented 1 year ago

请尝试使用最新版本复现。

Lipraty commented 1 year ago

fixed by 4.15.4. close.