💡 快速定位访问题:本附录汇总了OpenClaw使用过程中最常见的各类访问题及解决方案,帮助你快速排查和解决访问题。
症状:执行安装命令时报错
解决方案:
- 检查Node.js版本
node --version # 需要v22.14.0或更高版本(macOS 需要 v22.16.0+)- 使用官方中文安装脚本
curl -fsSL https://openclaw.ai/install.sh | bash- 使用npm直接安装
npm install -g openclaw- 检查网络连接
- 如果在国内,建议使用镜像源或中转API
症状:安装或运行时提示权限不足
解决方案:
# macOS/Linux
sudo npm install -g openclaw
# 或者使用nvm(推荐)
nvm install node
nvm use node
npm install -g openclaw症状:安装或更新时网络连接超时
解决方案:
- 使用国内镜像源
npm config set registry https://registry.npmmirror.com- 设置代理
npm config set proxy http://proxy-server:port
npm config set https-proxy http://proxy-server:port- 使用离线安装
# 下载安装包后本地安装
npm install -g ./openclaw-*.tgz症状:通过 npm install -g openclaw 安装后启动时报错:
Missing Control UI assets. You can build them yourself with: pnpm ui:build
或执行 pnpm ui:build 时又报错:
Cannot find module '.../scripts/ui.js'
原因:openclaw@2026.3.22 的 npm 包打包时遗漏了 scripts/ui.js 和预构建的 UI 资产文件,不是用户操作问题。
解决方案:
方法一:升级到最新版(推荐)
npm install -g openclaw@latest
openclaw --version # 确认版本为 2026.3.24 或更新方法二:确认 Node 版本是否符合要求
node --version
# Linux/WSL 需要 >= 22.14.0
# macOS 需要 >= 22.16.0如果版本不符合,先升级 Node:
# 使用 nvm 升级
nvm install 22
nvm use 22
npm install -g openclaw@latest方法三:仍报错则从源码构建(临时方案)
git clone https://github.com/openclaw/openclaw.git
cd openclaw
pnpm install
pnpm ui:build
pnpm build
⚠️ 注意:WSL 环境下建议优先使用方法一,升级到 v2026.3.24+ 后该问题已修复。
症状:提示API连接错误或超时
解决方案:
- 检查API Key是否正确
openclaw config get env | grep API_KEY- 测试API连接
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.anthropic.com/v1/messages- 检查网络
ping api.anthropic.com- 使用中转API(国内推荐)
- 参考附录C:API服务商对比
症状:API使用成本超出预算
解决方案:
- 使用国产模型
- DeepSeek:成本降低95%
- Kimi:长文档处理优惠
- GLM-4:中文友好
- 多模型组合
{
"env": {
"ANTHROPIC_API_KEY": "sk-ant-xxx",
"DEEPSEEK_API_KEY": "sk-xxx"
},
"agents": [
{
"name": "assistant",
"model": "claude-3-5-sonnet-20241022"
},
{
"name": "coder",
"model": "deepseek-chat"
}
]
}- 设置工具权限
openclaw config set tools.profile "coding" # 限制工具使用症状:执行openclaw daemon start后Gateway无法启动
解决方案:
- 检查配置文件
openclaw doctor # 诊断配置访问题- 检查端口占用
lsof -i :18789 # macOS/Linux
netstat -ano | findstr :18789 # Windows- 查看日志
tail -f ~/.openclaw/logs/gateway.log- 重启Gateway
openclaw daemon stop
openclaw daemon start症状:升级后Gateway拒绝启动,提示需要配置认证
解决方案:
# 设置token认证
openclaw config set gateway.auth.mode "token"
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
# 重启Gateway
openclaw daemon restart症状:提示18789端口已被占用
解决方案:
- 更改端口
openclaw config set gateway.port 18790- 停止占用端口的进程
# 查找并停止占用进程
lsof -ti :18789 | xargs kill -9症状:clawhub install命令执行失败
解决方案:
- 检查网络连接
ping clawhub.ai- 使用ClawHub镜像(如有)
clawhub install skill-name --registry https://mirror.clawhub.ai- 手动安装
# 下载Skill源码
git clone https://github.com/user/skill-repo.git
# 安装依赖
cd skill-repo
npm install
# 复制到Skills目附录
cp -r . ~/.openclaw/skills/skill-name症状:安装Skill后功能无法使用
解决方案:
- 检查Skill配置
cat ~/.openclaw/skills/skill-name/SKILL.md- 重启Gateway
openclaw daemon restart- 检查Skill权限
openclaw config get skills.allowlist- 查看错误日志
tail -f ~/.openclaw/logs/skills.log解决方案:
# 使用clawhub卸载
clawhub uninstall skill-name
# 手动删除
rm -rf ~/.openclaw/skills/skill-name
# 重启Gateway
openclaw daemon restart症状:多个Skills功能冲突
解决方案:
- 检查Skills列表
clawhub list- 禁用冲突Skills
{
"skills": {
"denylist": ["skill-a", "skill-b"]
}
}- 使用版本管理
clawhub install skill-name@version症状:给飞书Bot发布送消息无响应
解决方案:
- 检查Bot状态
openclaw status- 检查飞书配置
openclaw config get channels.feishu- 验证Webhook
curl -X POST https://open.feishu.cn/open-apis/bot/v2/hook/xxx \
-H "Content-Type: application/json" \
-d '{"msg_type":"text","content":{"text":"测试"}}'- 使用飞书配置检查清单
- 参考:附录J:飞书配置检查清单
症状:企业微信Bot无法接入
解决方案:
- 检查应用Secret
- 验证回调URL
- 检查通讯附录权限
- 参考第9章节配置步骤
症状:想在微信中使用 OpenClaw 智能体
解决方案:
OpenClaw 提供了官方微信接入方案 ClawBot(橙皮书 v1.4 新增):
-
安装官方插件:
openclaw plugins install @openclaw/wechat-clawbot
-
启用微信渠道:
openclaw config set channels.wechat.enabled true
-
重启 Gateway:
openclaw gateway restart
注意事项:
- ClawBot 基于 WeChatFerry,目前仅支持 Windows
- 强烈建议使用小号,有封号风险
- 详见 第9章 9.5 微信接入
症状:Telegram Bot不回复消息
解决方案:
- 检查Bot Token
openclaw config get channels.telegram.botToken- 与Bot发布起对话
curl https://api.telegram.org/bot<TOKEN>/getMe- 检查Webhook设置
curl https://api.telegram.org/bot<TOKEN>/getWebhookInfo解决方案:
- 使用更快的模型
- DeepSeek:国内访问快
- Claude 3.5 Sonnet:平衡速度和质量
- 减少上下文
# 定期清理会话历史
openclaw chat clear- 优化配置
{
"agents": [{
"maxTokens": 4096, # 减少输出长度
"temperature": 0.7
}]
}解决方案:
- 限制会话数量
openclaw config set sessions.max 10- 定期重启Gateway
openclaw daemon restart- 使用Docker部署
docker run -d --memory="2g" openclaw/openclaw解决方案:
- 清理日志文件
rm -rf ~/.openclaw/logs/*.log- 清理缓存
rm -rf ~/.openclaw/cache/*- 清理旧会话
openclaw session prune --days 30- 第2章节:安装部署 - 完整安装指南
- 第8章节:Skills扩展 - Skills使用管理
- 第9章节:多平台集成 - 平台接入配置
- 第11章节:高级配置 - 模型、记忆、审批与性能
最后更新:2026年3月27日 适用版本:OpenClaw v2026.3.7+(Q4 适用 v2026.3.22+)