本页内容
本页内容
安装方式
Node.js
OpenClaw 要求使用 Node 22.22.3+、Node 24.15+ 或 Node 25.9+。Node 24 是安装、CI 和发布工作流的默认及推荐运行时;Node 22 仍通过活跃的 LTS 版本线获得支持。不支持 Node 23。安装脚本会自动检测并安装 Node——如果你想自行设置 Node(版本、PATH、全局安装),请使用本页面。
检查版本
推荐默认使用 v24.15.0 或更新的 24.x 版本。v22.22.3 或更新的 22.x 版本是受支持的 Node 22 LTS 路径;Node v25.9.0+ 也受支持。不支持 Node 23。如果未安装 Node 或其版本不在支持范围内,请选择下方的一种安装方式。
安装 Node
macOS
Homebrew(推荐):
或从 nodejs.org 下载 macOS 安装程序。
Linux
Ubuntu / Debian:
Fedora / RHEL:
或使用版本管理器(见下文)。
Windows
winget(推荐):
Chocolatey:
或从 nodejs.org 下载 Windows 安装程序。
使用版本管理器(nvm、fnm、mise、asdf)
故障排查
openclaw: command not found
这几乎总是意味着 npm 的全局 bin 目录不在 PATH 中。
查找 npm 的全局前缀
检查它是否在 PATH 中
在输出中查找 <npm-prefix>/bin(macOS/Linux)或 <npm-prefix>(Windows)。
将其添加到 shell 启动文件
macOS / Linux
添加到 ~/.zshrc 或 ~/.bashrc:
然后打开一个新终端(或在 zsh 中运行 rehash,在 bash 中运行 hash -r)。
Windows
通过 Settings → System → Environment Variables,将 npm prefix -g 的输出添加到系统 PATH。
npm install -g 的权限错误(Linux)
如果看到 EACCES 错误,请将 npm 的全局前缀切换到用户可写目录:
将 export PATH=... 这一行添加到 ~/.bashrc 或 ~/.zshrc,使其永久生效。