环境
Windows 10 专业工作站版 22H2 19045.5737(VMware Workstation 17 KVM 4G RAM)
Administrator
OpenClaw 2026.3.11 (29dc654)
Node.js 22
Git 2.53.0.2
错误
一、安装时一闪而过
使用官方推荐命令安装,执行后(在安装node js后)PowerShell直接退出。后续重新运行,则界面一闪而过。
iwr -useb https://openclaw.ai/install.ps1 | iex解决
直接将 install.ps1 下载后,本地运行,发现有错误提示,但是由于没有暂停,导致程序直接退出。
[OK] Node.js v24.14.0 found
Error: Git is required to install OpenClaw. Install Git for Windows: https://git-scm.com/download/虚拟机环境缺少 git 程序,前往:git-scm.com 下载安装即可
二、powershell : node.exe : npm error code 3221225477
继续安装,发现报错 powershell : node.exe : npm error code 3221225477
[OK] Windows detected
[*] Existing OpenClaw installation detected
[OK] Node.js v24.14.0 found
[*] Installing OpenClaw (openclaw@latest)...
powershell : node.exe : npm error code 3221225477
所在位置 行:8 字符: 1
+ powershell -ExecutionPolicy Bypass -File install.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (node.exe : npm error code 3221225477:S
tring) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
所在位置 行:1 字符: 1
+ & "C:\Program Files\nodejs/node.exe" "C:\Program Files\nodejs/node_mo ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (npm error code 3221225477:String) [], R
emoteException
+ FullyQualifiedErrorId : NativeCommandError解决
定位发现是卡在 npm 安装 openclaw 最新版出现问题。
$npmOutput = npm install -g "$packageName@$Tag" 2>&1PowerShell 运行如下命令,安装 Microsoft.VisualStudio.2022.BuildTools。
winget install --id Microsoft.VisualStudio.2022.BuildTools --source winget --accept-package-agreements --accept-source-agreements等待 Microsoft.VisualStudio.2022.BuildTools 安装完成,然后将其运行打开,然后选择修改。
打开后,勾选使用 C++ 的桌面开发,其他保持默认,右下角持续确定、最后安装完成即可。
默认安装的 Node JS 是 24,网上及官方建议安装为 22 及以上,同时网上有人说这个可能与版本有关(程序也卡在 npm 安装),于是将其改为 22。(但是应该不影响,大概率是 C++ 环境缺失导致)
在程序中卸载 Node.js 24,管理员权限运行 cmd,清理 node 遗留文件。
rd /s /q "C:\Users\Administrator\AppData\Roaming\npm"
rd /s /q "C:\Users\Administrator\AppData\Local\npm-cache"然后 install.ps1 搜索 OpenJS.NodeJS.LTS,找到对应安装行,将其改为安装 Node.js 22。
#winget install OpenJS.NodeJS.LTS --accept-package-agreements --accept-source-agreements
#改为
winget install --id OpenJS.NodeJS.22 --accept-package-agreements --accept-source-agreements后重新运行 install.ps1,即可。
如果此处仍然报错,重启电脑重新运行安装程序即可。