(port: number)
| 27 | * 返回端口被占用时统一的友好报错文案。 |
| 28 | */ |
| 29 | export function formatPortInUseError(port: number): string { |
| 30 | return [ |
| 31 | ``, |
| 32 | ` ✖ Error: port ${port} is already in use.`, |
| 33 | ``, |
| 34 | ` Another process (possibly a ChatLab instance) is using this port. You can:`, |
| 35 | ` • Use another port: chatlab start --port <port>`, |
| 36 | ` • Find the process: lsof -iTCP:${port} -sTCP:LISTEN`, |
| 37 | ``, |
| 38 | ].join('\n') |
| 39 | } |