-
Notifications
You must be signed in to change notification settings - Fork 204
Open
Description
问题描述
使用 linux-deploy.sh 部署 ClawPanel Web 版后,面板显示「OpenClaw CLI 未安装」,但终端中 which openclaw 可正常返回路径。
复现步骤
- 在 Linux 上执行部署脚本:
curl -fsSL https://raw.githubusercontent.com/qingchencloud/clawpanel/main/scripts/linux-deploy.sh | bash - 打开面板 http://IP:1420
- 服务管理页显示「OpenClaw CLI 未安装」
原因分析
systemd 服务配置缺少 PATH 环境变量:
[Service]
Environment=NODE_ENV=production HOME=/home/sc-openclaw
# 缺少 PATH 配置dev-api.js 中的 findOpenclawBin() 函数使用 which openclaw 检测 CLI,但在 systemd 环境下默认 PATH 不包含 npm 全局安装路径(如 ~/.npm-global/bin),导致检测失败。
环境信息
- OS: Ubuntu x86_64
- Node.js: v22.22.1
- npm 全局路径:
/home/sc-openclaw/.npm-global/bin - OpenClaw: 2026.3.24 (通过 npm 全局安装)
- ClawPanel: v0.10.0
修复建议
方案 1:在部署脚本中为 systemd 服务添加 PATH
Environment=PATH=/home/sc-openclaw/.npm-global/bin:/usr/local/bin:/usr/bin:/bin方案 2:在 dev-api.js 中补充扫描 npm 全局路径
// findOpenclawBin 函数中添加
candidates.push(path.join(home, '.npm-global/bin/openclaw'))Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels