除非有特殊原因,否则请使用安装器。它会设置 CLI 并运行新手引导。
curl -fsSL https://openclaw./install.sh | bash
Windows(PowerShell):
iwr -useb https://openclaw.ai/install.ps1 | iex
下一步(如果你跳过了新手引导):
openclaw onboard –install-daemon
通过 npm 全局安装并运行新手引导。
curl -fsSL https://openclaw.ai/install.sh | bash
安装器标志:
curl -fsSL https://openclaw.ai/install.sh | bash -s – –help
详情:安装器内部原理。 非交互式(跳过新手引导):
curl -fsSL https://openclaw.ai/install.sh | bash -s – –no-onboard
如果你已经有 Node:
npm install -g openclaw@latest
如果你全局安装了 libvips(macOS 上通过 Homebrew 安装很常见)且安装失败,请强制使用预构建二进制文件:
SHARPIGNOREGLOBAL_LIBVIPS=1 npm install -g openclaw@latest
如果你看到,要么安装构建工具(macOS:Xcode CLT +),要么使用上面的变通方法来跳过原生构建。 或使用 pnpm:
pnpm add -g openclaw@latest pnpm approve-builds -g # 批准 openclaw、node-llama-cpp、sharp 等 pnpm add -g openclaw@latest # 重新运行以执行 postinstall 脚本
pnpm 需要显式批准带有构建脚本的包。在首次安装显示”Ignored build scripts”警告后,运行并选择列出的包,然后重新运行安装以执行 postinstall 脚本。 然后:
openclaw onboard –install-daemon
git clone https://github.com/openclaw/openclaw.git cd openclaw pnpm install pnpm ui:build # 首次运行时自动安装 UI 依赖 pnpm build openclaw onboard –install-daemon
提示:如果你还没有全局安装,请通过运行仓库命令。
安装器支持两种方式:
显式 npm curl -fsSL https://openclaw.ai/install.sh | bash -s – –install-method npm # 从 GitHub 安装(源代码 checkout) curl -fsSL https://openclaw.ai/install.sh | bash -s – –install-method git
常用标志:
等效的环境变量(对自动化有用):
快速诊断:
node -v npm -v npm prefix -g echo “\(PATH"
如果(macOS/Linux)或(Windows)不在的输出中,你的 shell 无法找到全局 npm 二进制文件(包括)。 修复:将其添加到你的 shell 启动文件(zsh:,bash:):
macOS / Linux export PATH="\)(npm prefix -g)/bin:$PATH”
在 Windows 上,将的输出添加到你的 PATH。 然后打开新终端(或在 zsh 中执行/ 在 bash 中执行)。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/228915.html