一、环境准备
1.1 安装 Node.js
brew install node
验证安装:
npm -v # 输出:11.11.0
1.2 配置 npm 镜像源
配置淘宝镜像源以加速下载:
npm config set registry https://registry.npmmirror.com
验证配置:
npm config get registry # 输出:https://registry.npmmirror.com 即为配置成功
二、安装 OpenClaw
2.1 安装 OpenClaw
npm install -g openclaw@latest
验证安装:
openclaw --version # 输出:2026.3.2
2.2 向导式配置
openclaw onboard
在向导中选择:
- Onboarding mode: QuickStart(Configure details later via openclaw configure)
三、解决常见配置问题
3.1 解决 'origin not allowed' 错误
编辑配置文件 ~/.openclaw/openclaw.json,在 gateway 段中添加:
"gateway":{"controlUi":{"allowedOrigins":["*"]}}
3.2 解决 'pairing required' 错误
- 列出设备请求:
openclaw devices list
- 记录
RequestId - 批准设备配对:
openclaw devices approve <RequestId>

