Windows 安装 OpenClaw 报错 3221225477(0xC0000005)解决记录

现象

  • npm error code 3221225477
  • 安装 openclaw 时崩溃
  • 崩在 node-llama-cpppostinstall

错误含义

3221225477 = 0xC0000005 = Access Violation

= native 模块加载时发生非法内存访问
不是 npm 逻辑错误。

排查过程

  1. npm install -g cowsay 成功 → Node/npm 正常
  2. npm install openclaw --verbose
    → 崩在 [email protected]
  3. CPU 支持 AVX2 → 排除指令集问题
  4. 判断为 C++ 运行库缺失

根因

缺少:

Microsoft Visual C++ Redistributable 2015–2022 (x64)

native DLL 加载失败 → 触发 0xC0000005。

解决方法

安装:

VC_redist.x64.exe

安装后重新执行:

curl -fsSL https://openclaw.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

成功。

经验总结

Windows 出现:

npm error code 3221225477

优先检查:

  • C++ 运行库是否缺失
  • native addon 是否加载失败
  • 是否被 Defender 拦截

不要先怀疑 npm 或 Node 本身。