What version of Kimi Code CLI is running?
0.19.2
Which open platform/subscription were you using?
/login
Which model were you using?
kimi-for-coding,k2.7
What platform is your computer?
No response
What issue are you seeing?
我刚刚用kimi code的时候,发现使用/web 指令,会报错。
Starting Kimi server and opening web UI…
Error: Failed to start server: spawn EFTYPE。
然后我问kimicode,
他说:/web 会尝试后台启动一个 Kimi server daemon。代码里复用自身路径(dist/main.mjs)直接 spawn,但在 Windows 上
.mjs 文件不是可直接执行的二进制文件,所以 spawn 会报 EFTYPE("inappropriate file type or format")。这个 bug
和你是否刚更新没有直接关系,是 npm 安装的 Windows
版共有的问题;当然如果你刚更新到这个版本,那就是这次更新带来的回归。
我已经帮你打了个临时补丁(在 D:\nodejs\node_modules@moonshot-ai\kimi-code\dist\main.mjs 的 spawnDaemonChild 里加了
Windows 判断:如果 program 不是 .exe,就改成用 node.exe 运行脚本)。并且验证过可以成功启动 daemon、/healthz 返回200。是的,确实是我改的补丁起的作用 😄
核心逻辑是这样的:
- 没补丁前:Kimi 的 /web 在后台起 daemon 时,直接用 spawn('.../dist/main.mjs',
['server','run','--daemon',...])。Windows 不认识 .mjs 文件是可执行程序,所以报 spawn EFTYPE。
- 补丁后:我在 spawnDaemonChild 里加了判断,Windows 环境下如果 program 不是 .exe,就改成
spawn('D:\nodejs\node.exe', ['.../dist/main.mjs', 'server','run','--daemon',...]),这样 Windows 就能正常启动 daemon
了。
- 必须重启:因为 Node.js 进程启动后就把 main.mjs 读进内存了,你之前那个 Kimi
会话还是旧代码,所以第一次试还是报错;新开的 PowerShell 进程读到了修改后的文件,就成功了。
What steps can reproduce the bug?
我刚把kimicode cli用npm升级到现在的kimicode。启用kimi后(无论是powershell还是cmd),然后/web。就会报错,启动不了
What is the expected behavior?
No response
Additional information

---
### What version of Kimi Code CLI is running?
0.19.2
Which open platform/subscription were you using?
/login
Which model were you using?
kimi-for-coding,k2.7
What platform is your computer?
No response
What issue are you seeing?
When I just used kimi code, I found that using the /web command would report an error.
Starting Kimi server and opening web UI…
Error: Failed to start server: spawn EFTYPE.
Then I asked kimicode,
He said: /web will try to start a Kimi server daemon in the background. The code reuses its own path (dist/main.mjs) and spawns directly, but on Windows
.mjs files are not directly executable binary files, so spawn will report EFTYPE ("inappropriate file type or format"). this bug
It has no direct relationship with whether you have just updated. It is Windows installed by npm.
Issues common to previous versions; of course, if you have just updated to this version, it is a regression brought about by this update.
I have made a temporary patch for you (added to spawnDaemonChild in D:\nodejs\node_modules@moonshot-ai\kimi-code\dist\main.mjs
Windows judgment: If program is not .exe, use node.exe to run the script instead). And it has been verified that the daemon can be started successfully and /healthz returns 200. Yes, it is indeed the patch I changed that worked 😄
The core logic is this:
- Before the patch: When Kimi's /web starts the daemon in the background, directly use spawn('.../dist/main.mjs',
['server','run','--daemon',...]). Windows does not recognize the .mjs file as an executable program, so spawn EFTYPE is reported.
- After the patch: I added judgment to spawnDaemonChild. In Windows environment, if the program is not .exe, change it to
spawn('D:\nodejs\node.exe', ['.../dist/main.mjs', 'server','run','--daemon',...]), so that Windows can start the daemon normally
.
- Must be restarted: Because the main.mjs is read into the memory after the Node.js process is started, your previous Kimi
The session is still the old code, so the first try still reports an error; the newly opened PowerShell process reads the modified file and succeeds.
What steps can reproduce the bug?
I just upgraded the kimicode cli to the current kimicode using npm. After enabling kimi (either powershell or cmd), then /web. An error will be reported and cannot be started.
What is the expected behavior?
No response
Additional information

What version of Kimi Code CLI is running?
0.19.2
Which open platform/subscription were you using?
/login
Which model were you using?
kimi-for-coding,k2.7
What platform is your computer?
No response
What issue are you seeing?
我刚刚用kimi code的时候,发现使用/web 指令,会报错。
Starting Kimi server and opening web UI…
Error: Failed to start server: spawn EFTYPE。
然后我问kimicode,
他说:/web 会尝试后台启动一个 Kimi server daemon。代码里复用自身路径(dist/main.mjs)直接 spawn,但在 Windows 上
.mjs 文件不是可直接执行的二进制文件,所以 spawn 会报 EFTYPE("inappropriate file type or format")。这个 bug
和你是否刚更新没有直接关系,是 npm 安装的 Windows
版共有的问题;当然如果你刚更新到这个版本,那就是这次更新带来的回归。
我已经帮你打了个临时补丁(在 D:\nodejs\node_modules@moonshot-ai\kimi-code\dist\main.mjs 的 spawnDaemonChild 里加了
Windows 判断:如果 program 不是 .exe,就改成用 node.exe 运行脚本)。并且验证过可以成功启动 daemon、/healthz 返回200。是的,确实是我改的补丁起的作用 😄
核心逻辑是这样的:
['server','run','--daemon',...])。Windows 不认识 .mjs 文件是可执行程序,所以报 spawn EFTYPE。
spawn('D:\nodejs\node.exe', ['.../dist/main.mjs', 'server','run','--daemon',...]),这样 Windows 就能正常启动 daemon
了。
会话还是旧代码,所以第一次试还是报错;新开的 PowerShell 进程读到了修改后的文件,就成功了。
What steps can reproduce the bug?
我刚把kimicode cli用npm升级到现在的kimicode。启用kimi后(无论是powershell还是cmd),然后/web。就会报错,启动不了
What is the expected behavior?
No response
Additional information
0.19.2
Which open platform/subscription were you using?
/login
Which model were you using?
kimi-for-coding,k2.7
What platform is your computer?
No response
What issue are you seeing?
When I just used kimi code, I found that using the /web command would report an error.
Starting Kimi server and opening web UI…
Error: Failed to start server: spawn EFTYPE.
Then I asked kimicode,
He said: /web will try to start a Kimi server daemon in the background. The code reuses its own path (dist/main.mjs) and spawns directly, but on Windows
.mjs files are not directly executable binary files, so spawn will report EFTYPE ("inappropriate file type or format"). this bug
It has no direct relationship with whether you have just updated. It is Windows installed by npm.
Issues common to previous versions; of course, if you have just updated to this version, it is a regression brought about by this update.
I have made a temporary patch for you (added to spawnDaemonChild in D:\nodejs\node_modules@moonshot-ai\kimi-code\dist\main.mjs
Windows judgment: If program is not .exe, use node.exe to run the script instead). And it has been verified that the daemon can be started successfully and /healthz returns 200. Yes, it is indeed the patch I changed that worked 😄
The core logic is this:
['server','run','--daemon',...]). Windows does not recognize the .mjs file as an executable program, so spawn EFTYPE is reported.
spawn('D:\nodejs\node.exe', ['.../dist/main.mjs', 'server','run','--daemon',...]), so that Windows can start the daemon normally
.
The session is still the old code, so the first try still reports an error; the newly opened PowerShell process reads the modified file and succeeds.
What steps can reproduce the bug?
I just upgraded the kimicode cli to the current kimicode using npm. After enabling kimi (either powershell or cmd), then /web. An error will be reported and cannot be started.
What is the expected behavior?
No response
Additional information