nerve start -d 后 status 显示 not running(daemon 立即退出) #27

Closed
opened 2026-04-22 13:42:28 +00:00 by xingyue · 0 comments
Owner

What

nerve start -d 报告启动成功,但 nerve status 立即显示 not running。

Root Cause

packages/cli/src/commands/start.ts 第 101-103 行:

const selfPath = fileURLToPath(import.meta.url); // → dist/commands/start.js
const child = spawn(process.execPath, [selfPath, "start"], { ... });

selfPath 指向 start.js(命令模块),而非 CLI 入口 cli.js。子进程执行 node start.js start,但 start.js 只 export 了 command definition,没有 CLI 入口逻辑,所以进程立即退出。

Fix

selfPath 改为 CLI 入口文件路径(cli.js),或者在 start 模块中检测 NERVE_DAEMON_MODE 环境变量时直接执行 foreground 逻辑。

Reproduce

nerve start -d
nerve status  # → "😴 Nerve daemon is not running."

Priority

High — daemon 模式完全不可用。

## What `nerve start -d` 报告启动成功,但 `nerve status` 立即显示 not running。 ## Root Cause `packages/cli/src/commands/start.ts` 第 101-103 行: ```js const selfPath = fileURLToPath(import.meta.url); // → dist/commands/start.js const child = spawn(process.execPath, [selfPath, "start"], { ... }); ``` `selfPath` 指向 `start.js`(命令模块),而非 CLI 入口 `cli.js`。子进程执行 `node start.js start`,但 `start.js` 只 export 了 command definition,没有 CLI 入口逻辑,所以进程立即退出。 ## Fix 将 `selfPath` 改为 CLI 入口文件路径(`cli.js`),或者在 start 模块中检测 `NERVE_DAEMON_MODE` 环境变量时直接执行 foreground 逻辑。 ## Reproduce ```bash nerve start -d nerve status # → "😴 Nerve daemon is not running." ``` ## Priority **High** — daemon 模式完全不可用。
This repo is archived. You cannot comment on issues.
No Label
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/nerve#27