Skip to main content
OpenClaw requires Node 22.22.3+, Node 24.15+, or Node 25.9+ (which includes Node 26). Node 26 is the default and recommended runtime — it starts the Gateway noticeably faster and uses less memory than Node 24, and the installer script provisions it when Node is missing. CI and release workflows still pin Node 24; Node 22 remains supported via its LTS line. Node 23 is unsupported. The installer script detects and installs Node automatically — use this page when you want to set up Node yourself (versions, PATH, global installs).

检查你的版本

v26 (any release) is the recommended default. v24.15.0 or newer 24.x remains fully supported (and is what CI pins); v22.22.3 or newer 22.x is the supported Node 22 LTS path; Node v25.9.0+ is also supported. Node 23 is unsupported. If Node is missing or outside the supported range, pick an install method below.

安装 Node

Homebrew(推荐):
或从 nodejs.org 下载 macOS 安装程序。
版本管理器可以让你轻松在不同 Node 版本之间切换。常见选项:
  • fnm - 快速、跨平台
  • nvm - 在 macOS/Linux 上广泛使用
  • mise - 多语言(Node、Python、Ruby 等)
使用 fnm 的示例:
请在你的 shell 启动文件(~/.zshrc~/.bashrc)中初始化版本管理器。如果跳过这一步,在新的终端会话中可能找不到 openclaw,因为 PATH 不会包含 Node 的 bin 目录。

故障排查

openclaw: command not found

这几乎总是意味着 npm 的全局 bin 目录没有加入你的 PATH。
1

查找你的 npm 全局前缀

2

检查它是否在你的 PATH 中

在输出中查找 <npm-prefix>/bin(macOS/Linux)或 <npm-prefix>(Windows)。
3

将其添加到你的 shell 启动文件

添加到 ~/.zshrc~/.bashrc
然后打开一个新的终端(或在 zsh 中运行 rehash / 在 bash 中运行 hash -r)。

npm install -g 的权限错误(Linux)

如果你看到 EACCES 错误,请将 npm 的全局前缀切换到一个用户可写的目录:
export PATH=... 这一行添加到你的 ~/.bashrc~/.zshrc 中,以使其永久生效。

相关内容