Node.js 安装
使用 Node.js 安装 OpenClaw。
前置条件
- Node.js 18+
- npm 或 pnpm
安装步骤
1. 安装 Node.js
使用 nvm(推荐)
bash
# 安装 nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
# 安装 Node.js 20
nvm install 20
nvm use 20使用包管理器
bash
# macOS
brew install node@20
# Ubuntu/Debian
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs2. 安装 OpenClaw
bash
# 使用 npm
npm install -g openclaw@latest
# 使用 pnpm
pnpm add -g openclaw@latest
# 使用 yarn
yarn global add openclaw@latest3. 验证安装
bash
openclaw --version更新
bash
# npm
npm update -g openclaw
# pnpm
pnpm update -g openclaw
# yarn
yarn global upgrade openclaw卸载
bash
npm uninstall -g openclaw