Files
openclaw-config/scripts/bin/openclaw
T
yangxuan ae7ca0c005 fix(cli): 新增 openclaw 包装脚本固定 Node 26,修 P0-1 的 CLI 拒跑
- 根因: 入口 openclaw.mjs 是 #!/usr/bin/env node,非交互 shell 的 PATH 不含 nvm
  目录,node 落到系统 /usr/bin/node = v22.23.1,报 node:sqlite NUL 错误拒绝运行
- 方案: scripts/bin/openclaw 用绝对路径固定 node v26.8.2;实测 models list /
  doctor 均正常(此前 models list 直接报错)
- 未选方案: 删 /usr/bin/node 会破坏 Debian 包依赖(dpkg -S nodejs 拥有);
  删 nvm 会让 gateway 服务无法启动(ExecStart 指向 nvm 26 路径)
2026-09-16 16:27:55 +08:00

7 lines
448 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/sh
# 固定用 nvm 的 Node 26 运行 openclaw CLI。
# 起因: openclaw 入口是 "#!/usr/bin/env node",非交互 shell 的 PATH 不含 nvm
# 会落到系统 /usr/bin/node (v22) 并报 node:sqlite NUL 错误而拒跑。
# 详见 docs/openclaw-API响应性能分析与优化.md 的 P0-1。
exec "/home/yangxuan/.nvm/versions/node/v26.8.2/bin/node" "/home/yangxuan/.nvm/versions/node/v26.8.2/lib/node_modules/openclaw/openclaw.mjs" "$@"