💡 快速定位访问题:本附录汇总了OpenClaw使用过程中最常见的各类访问题及解决方案,帮助你快速排查和解决访问题。
症状:执行安装命令时报错
解决方案:
- 检查Node.js版本
node --version # 需要v18.0.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症状:提示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章节配置步骤
症状: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月16日 适用版本:OpenClaw v2026.3.7+