Node 问题

Node + tsx "__name is not a function" 崩溃

概述

使用 Node 运行 OpenClaw(配合 tsx)在启动时失败:

[openclaw] Failed to start CLI: TypeError: __name is not a function
    at createSubsystemLogger (.../src/logging/subsystem.ts:203:25)
    at .../src/agents/auth-profiles/constants.ts:25:20

这个问题出现在将 dev 脚本从 Bun 切换到 tsx 之后(commit 2871657e,2026-01-06)。同样的运行时路径在 Bun 下工作正常。

环境

复现步骤(仅 Node)

# 在仓库根目录
node --version
pnpm install
node --import tsx src/entry.ts status

仓库中的最小复现

node --import tsx scripts/repro/tsx-name-repro.ts

Node 版本检查

备注 / 假设

回归历史

解决方案

参考链接

后续步骤