环境准备
先确认本机的 npm 和 Node.js 版本。
npm -v
node -v
Node.js 版本需要大于等于 22.00,不满足的话,后面的安装过程大概率会卡住,或者装完也跑不起来。
安装 OpenClaw
如果系统里已经装过旧版本,可以先卸掉:
npm uninstall -g openclaw
正式安装时用全局安装命令:
sudo npm i -g openclaw
执行后系统会要求输入密码,macOS 终端里默认不会显示字符,这很正常。
安装完成后,终端里通常会看到类似下面的提示:
npm warn deprecated npmlog@6.0.2: This package is no longer supported.
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory...
npm warn deprecated tar@6.2.1: Old versions of tar are not supported...
added 711 packages in 4m
130 packages are looking for funding
run `npm fund` for details

实际装的时候,我更在意的是两类常见报错:一个是 Git 拉取失败,另一个是权限不够。
注意事项:可能出现的两种错误
Git 连接错误
执行
npm uninstall -g openclaw时,可能会看到fatal: unable to access 'https://github.com/whiskeysockets/libsignal-node.git/'。解决方案:把 Git 下载协议改成 HTTPS。














