本文基于 OpenClaw GitHub 仓库中社区反馈最多的真实 Issue,整理出 100 个安装与使用中最常见的报错问题。每个问题附有错误信息、原因分析和解决方案。点击分类快速跳转:
#1 – #18:npm 安装失败、权限、平台兼容等
#19 – #32:pairing required、启动失败、超时等
#33 – #55:WhatsApp/Telegram/Discord/飞书等
#56 – #72:Ollama/Claude/OpenAI/Gemini 对接
#73 – #82:配置损坏、验证失败、迁移等
#83 – #89:OAuth、Token、API Key 等
#90 – #95:插件安装失败、加载异常等
#96 – #100:Token 消耗、内存、速度等
node -v # 确保 >= 22 npm cache clean --force npm install -g openclaw@latest --registry=https://registry.npmmirror.com如果仍然失败,尝试使用 pnpm:
pnpm add -g openclaw@latest
# 方案1:修复 npm 全局目录权限 mkdir -p ~/.npm-global npm config set prefix '~/.npm-global' echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc source ~/.bashrc # 方案2:Docker 中显式指定用户 docker run --user $(id -u):$(id -g) ...
openclaw onboard。
# 安装 WSL2 wsl --install # 在 WSL 中安装 npm install -g openclaw@latest
# 确认 npm 全局 bin 位置 npm bin -g # 添加到 PATH echo 'export PATH=$(npm bin -g):$PATH' >> ~/.zshrc source ~/.zshrc # 使用新命令名 openclaw --version
# 完全卸载后重装 npm uninstall -g openclaw npm cache clean --force npm install -g openclaw@latest # 或使用 pnpm(更可靠的全局安装) pnpm add -g openclaw@latest
# 启用用户级 systemd(lingering) sudo loginctl enable-linger $USER # 手动创建 service openclaw gateway install
sudo loginctl enable-linger $USER systemctl --user daemon-reload openclaw gateway install openclaw gateway start
bun 替代 npm 运行以提升启动速度;③降低工作区文件注入量。
# 检查端口占用 lsof -i :3007 # 手动重启 Gateway openclaw gateway stop openclaw gateway start # 检查 launchd 日志 cat ~/.openclaw/logs/gateway.log
# 提高文件描述符限制 ulimit -n 4096 # 重启 Gateway openclaw gateway restart
rm -rf ~/.openclaw/workspace/sessions/*
openclaw sessions prune,或设置会话自动过期。
rm -rf node_modules package-lock.json npm install npm run build
openclaw models add,或直接编辑 ~/.openclaw/openclaw.json 中的 models 部分。
# 重新配对 openclaw gateway pair # 如果仍失败,重启 Gateway openclaw gateway restart
openclaw gateway stop openclaw gateway pair --force openclaw gateway start
openclaw gateway status # 如果未运行 openclaw gateway start # 检查端口 3007 是否被占用 lsof -i :3007 # macOS/Linux netstat -ano | findstr 3007 # Windows
openclaw gateway pair 重新配对,或将 Gateway 绑定到 0.0.0.0。
--keep-alive;③查看 Gateway 日志排查具体断开原因。
launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/ai.openclaw.gateway.plist openclaw gateway install openclaw gateway start
~/.openclaw/openclaw.json,移除 plugins.entries 中重复的 feishu 条目,然后 openclaw gateway restart。
openclaw plugins install --all openclaw gateway restart
openclaw gateway pair --scopes=operator.read,operator.write
npm update -g openclaw@latest
openclaw gateway pair 获取新格式 token。
# 清除 WhatsApp 会话缓存 rm -rf ~/.openclaw/workspace/channels/whatsapp/ # 重新配对 openclaw channels add whatsapp
~/.openclaw/openclaw.json,将 Telegram 配置移到正确的 channels 字段下。
openclaw plugins install @openclaw/telegram openclaw gateway restart
"streaming": false,使用非流式模式。
NODE_EXTRA_CA_CERTS 环境变量,或配置 HTTPS_PROXY 环境变量让 Node 也走代理。
export HTTPS_PROXY=http://your-proxy:port openclaw gateway restart
"reasoning": false 关闭推理输出。
# 使用社区维护的飞书插件 openclaw plugins install @m1heng/clawdbot-feishu openclaw gateway restart
outputMode: "full",或升级到已修复此行为的版本。
openai-completions API 类型配置。
google-chrome --remote-debugging-port=18800并在配置中设置正确的
cdpPort。
"remoteCdpTimeoutMs": 5000;确保 Chrome 进程稳定运行。
--no-tui 模式运行:openclaw chat --no-tui
cat ~/.openclaw/logs/gateway.log | tail -50;③开启调试模式:openclaw --verbose
ollama list;②模型名需与 ollama list 输出一致(如 llama3.2 而非 llama-3.2)。
"baseUrl": "http://remote-host:11434/v1"。
"id": "deepseek-r1:latest"
npm update -g openclaw@latest,升级后 Antigravity 集成会自动更新。
npm install -g @anthropic-ai/gemini-cli # 或配置 Gemini 使用 API 模式而非 CLI
"reasoning": false。
openclaw models add anthropic,使用 API Key 模式而非 OAuth。
openclaw auth login anthropic;或直接使用 API Key 模式。
"contextWindow": 32768 和 "maxTokens": 8192。
"toolCalling": true;③或关闭工具调用。
"compat" 字段适配。
"id": "openrouter/openrouter/auto"
"tools": [] 禁用工具。
cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.bak;升级到已修复的版本。
openclaw configure 命令将脱敏后的 "sk-***" 写回了配置文件。cp ~/.openclaw/openclaw.json.bak ~/.openclaw/openclaw.json;升级到已修复版本。
openclaw gateway restart # 如果仍不工作 npm update -g openclaw@latest openclaw gateway restart
npm install -g openclaw@2026.3.5;避免频繁升级。
openclaw tools list;③重启 Gateway。
openclaw auth login;或切换为使用 API Key 模式。
"api": "openai-chat" 模式。
"caching": true;③减少系统提示变化频率。
openclaw plugins install diagnostics-otel --force;或在配置中禁用 OTel 诊断。
# 使用 pnpm 安装 pnpm add -g openclaw@latest # 或手动指定扩展路径 openclaw plugins install --registry=https://registry.npmmirror.com <plugin-name>
"contextWindow" 值;②使用 /clear 清除历史;③减少工作区文件注入量。
"maxHistoryMessages" 限制携带的历史条数。
.clawignore 排除不需要的文件;减小工作区范围。
# 回退到已知稳定版本 npm install -g openclaw@2026.3.3 # 或完全重装 npm uninstall -g openclaw npm cache clean --force npm install -g openclaw@latest
openclaw gateway stop rm -rf ~/.openclaw/workspace/indexes/ openclaw gateway start