OpenClaw 安装排错笔记(Windows + nvm + Git)
优先检查:1️⃣ Node 版本2️⃣ GitHub 网络3️⃣ Git 代理。
·
OpenClaw 安装排错笔记(Windows + nvm + Git)
一、环境目标
安装并运行 OpenClaw CLI 工具。
最终成功运行:
openclaw onboard --flow quickstart
输出:
🦞 OpenClaw 2026.3.2
Runs on a Raspberry Pi. Dreams of a rack in Iceland.
说明安装成功。
二、环境组件
本次涉及的关键工具:
| 工具 | 作用 |
|---|---|
| Node.js | JavaScript 运行环境 |
| npm | Node 包管理器 |
| nvm | Node 版本管理 |
| Git | 代码仓库管理 |
| GitHub | 依赖下载源 |
| 代理软件 | 访问 GitHub |
三、完整安装流程
1 安装 nvm
Windows 使用 nvm-windows
安装后:
nvm install 22
nvm use 22
检查版本:
node -v
npm -v
结果:
node v22.22.0
npm 11.11.0
四、安装 OpenClaw
运行官方安装脚本:
iwr -useb https://openclaw.ai/install.ps1 | iex
五、遇到的问题与解决方案
问题 1:Node 版本过高
最开始系统 Node:
Node v24
安装时报错:
npm error code 128
原因:
OpenClaw 依赖库不兼容 Node 24。
解决:
使用 nvm 切换 Node 22
nvm use 22
问题 2:系统 Node 未被 nvm 接管
安装脚本检测:
Node.js v24 found
原因:
系统 PATH 中仍有旧 Node。
解决:
卸载系统 Node,仅使用 nvm。
问题 3:GitHub 访问失败
错误:
npm error code 128
进一步检查:
git ls-remote https://github.com/npm/cli.git
报错:
Failed to connect to github.com port 443
说明:
Git 无法访问 GitHub。
问题 4:Git 代理配置错误
发现 Git 配置:
mirror.ghproxy.com
fastgit
这些镜像已经失效。
解决:
删除配置:
git config --global --unset url."https://mirror.ghproxy.com/https://github.com/".insteadOf
git config --global --unset url."https://hub.fastgit.org/".insteadOf
问题 5:代理端口错误
代理软件端口:
127.0.0.1:7897
但 Git 未配置代理。
解决:
git config --global http.proxy http://127.0.0.1:7897
git config --global https.proxy http://127.0.0.1:7897
六、验证 Git 网络
测试:
git ls-remote https://github.com/npm/cli.git
成功返回:
hash refs/heads/main
...
说明 GitHub 网络正常。
七、重新安装 OpenClaw
再次执行:
iwr -useb https://openclaw.ai/install.ps1 | iex
安装成功。
八、启动 OpenClaw
运行:
openclaw onboard --flow quickstart
输出:
OpenClaw 2026.3.2
说明 CLI 成功安装。
九、最终环境状态
Node:
v22.22.0
npm:
11.11.0
Git:
2.37.1
代理:
127.0.0.1:7897
GitHub 连接:
正常
OpenClaw:
已成功运行
十、关键经验总结
1 Node 项目常见失败原因
优先检查:
1️⃣ Node 版本
2️⃣ GitHub 网络
3️⃣ Git 代理
4️⃣ npm registry
2 npm error 128 的真正含义
通常表示:
Git clone 失败
而不是 npm 本身问题。
3 Windows 常见环境坑
| 问题 | 原因 |
|---|---|
| Node 版本冲突 | 系统 Node + nvm |
| GitHub 无法访问 | 网络或代理 |
| fastgit / ghproxy | 镜像失效 |
| npm error 128 | Git 失败 |
十一、最终成功环境结构
Windows
├─ nvm
│ └─ Node 22
│
├─ npm
│
├─ Git
│ └─ proxy 127.0.0.1:7897
│
└─ OpenClaw CLI
十二、一键验证环境
以后可以快速测试:
node -v
npm -v
git --version
git ls-remote https://github.com/npm/cli.git
openclaw --version
更多推荐




所有评论(0)