本地/服务器、npm 全局安装、无自定义插件、无复杂通道 步骤: # 备份(必做)
cp -r ~/.openclaw ~/.openclaw.bak
# 卸载
openclaw gateway stop
npm uninstall -g openclaw
# 安装最新版本
npm i -g openclaw@latest --registry=https://registry.npmmirror.com
# 自动修复配置/插件
openclaw doctor --fix
# 重启
openclaw gateway restart耗时:5~15 分钟 下载+安装:1~3 分钟 配置迁移+修复:2~5 分钟 重启+验证:1~2 分钟
有旧插件、飞书/微信/钉钉通道、自定义模型配置 额外耗时: 旧插件全部失效,要在 ClawHub 重装适配版 通道配置(飞书/微信)要重配 旧配置项(memory 等)要手动删改 总耗时:20~40 分钟
源码安装、Docker、多实例、自定义插件、企业通道(飞书/Teams) 典型问题: Node 版本不够(要求 Node 22.14+) 旧插件 API 完全失效 沙箱/权限/网络报错 配置结构大变,自动修复不全,要手动改 总耗时:1~3 小时(甚至更久)
先备份:~/.openclaw 整个目录 优先用 npm 升级,别用源码/openclaw update 升级后必跑:openclaw doctor --fix(自动迁移配置) 插件全删重装:旧 2.x 插件100% 不能用 通道重配:飞书/微信/Teams 要重新绑定
# 进入配置目录
cd ~/.openclaw
mkdir -p devices
cd devices
# 强制自动批准所有本地节点
echo'{
"silent": true,
"autoApprove": ["cli", "browser", "node", "local"],
"autoapproveFirst": true
}' | Out-File pending.json -Encoding utf8
# 关闭配对校验
openclaw config set gateway.nodes.pairingMode disabled
openclaw config set gateway.nodes.autoApproveLocal true
openclaw config set gateway.nodes.denyCommands []openclaw config set tools.profile full
openclaw config set tools.exec.host gateway
openclaw config set tools.exec.security full
openclaw config set tools.exec.ask off
openclaw config set tools.exec.envPassthrough true
openclaw config set tools.deny @()openclaw gateway restart# 测试环境变量是否能读到
openclaw exec"echo %BAIDU_API_KEY%"
# 测试百度搜索技能
openclaw chat "帮我搜索 今天天气"✅ 不再出现 pairing required ✅ exec 完全无限制
夜雨聆风