彻底卸载 OpenClaw-CN(无残留版)

🧹 彻底卸载 OpenClaw-CN(无残留版)
下面是完整卸载流程,能把程序、配置、缓存、系统服务全部清干净,方便你重装:
1. 先停掉所有相关服务和进程
powershell
# 停止网关服务
openclaw-cn gateway stop 2>&1 | Out-Null

# 强制杀死所有 node 和 openclaw 相关进程
taskkill /f /im node.exe 2>&1 | Out-Null
taskkill /f /im openclaw-cn.exe 2>&1 | Out-Null
2. 卸载 npm 全局安装的包(核心步骤)
powershell
npm uninstall -g openclaw-cn
3. 删除所有配置和缓存目录(清残留)
powershell
# 删除用户目录下的配置文件夹
Remove-Item "$env:USERPROFILE\.openclaw" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item "$env:USERPROFILE\.openclaw-cn" -Recurse -Force -ErrorAction SilentlyContinue

# 清理 npm 缓存
npm cache clean --force
4. 清理系统层面的端口转发和防火墙规则
powershell
# 删除之前添加的端口转发规则(18789/18790)
netsh interface portproxy delete v4tov4 listenaddress=0.0.0.0 listenport=18789 2>&1 | Out-Null
netsh interface portproxy delete v4tov4 listenaddress=0.0.0.0 listenport=18790 2>&1 | Out-Null

# 删除之前添加的防火墙规则
Remove-NetFirewallRule -DisplayName "OpenClaw Gateway" -ErrorAction SilentlyContinue
✅ 验证是否卸载干净
执行下面命令,如果提示「不是内部或外部命令」,就说明已经卸载干净了:
powershell
openclaw-cn --version
🚀 重装建议(避免再踩坑)
卸载干净后,用国内镜像重装最新版,速度更快更稳定:
powershell
npm install -g openclaw-cn --registry=https://registry.npmmirror.com
安装完成后,按下面配置(换个端口,避免被系统占用):
powershell
openclaw-cn config set gateway.bind 0.0.0.0
openclaw-cn config set gateway.port 18790
openclaw-cn gateway start
💡 总结
这套流程会把 程序本体 + 配置文件 + 缓存 + 系统网络规则 全部清空,相当于「恢复出厂设置」,之后重装就不会有任何旧配置干扰了。

世界树

一步一步来

您可能还喜欢...