OpenClaw(小龙虾)源码部署详细步骤:Node+Git+Bash 一站式
摘要:本文介绍OpenClaw项目在Windows系统下的环境配置与运行指南。要求Node.js≥22.12.0,推荐使用v24.14.0版本。针对多版本Node共存问题,提供了临时环境变量设置方法(CMD/PowerShell/Bash)。详细说明了Git Bash的安装步骤及使用场景,特别解决了Windows下bash命令报错问题。项目构建流程包括:设置高版本Node路径、验证环境、安装依赖(
1. 系统要求
-
Node.js: 版本 >= 22.12.0
-
包管理器: npm、pnpm 或 bun
-
git bash win10支持bash命令
-
操作系统:
-
macOS: 直接支持
-
Linux: 直接支持
-
win10 支持
-
2.Node安装
-
下载 Node.js v24.14.0 压缩包
-
解压到项目根目录的 node-v24.14.0-win-x64 文件夹
-
使用相对路径运行 Node.js:
.\node-v24.14.0-win-x64\node.exe -v -
我电脑安装了两个node,一个是18.12版本,OpenClaw需要高版本的node,OpenClaw使用node的时候需要临时设置变量,内容如下:
:: 临时设置node环境变量 set PATH=E:\ai\aicode\traeHome\workHome\openclaw-main\node-v24.14.0-win-x64;%PATH% :: 临时设置node环境变量(PowerShell) $env:PATH = "E:\ai\aicode\traeHome\workHome\openclaw-main\node-v24.14.0-win-x64;$env:PATH" :: 临时设置node环境变量(bash) export PATH="/e/ai/aicode/traeHome/workHome/openclaw-main/node-v24.14.0-win-x64:$PATH"这样你就可以使用 node <命令> 来执行 Node.js 命令。
-
安装pnpm
npm config set registry https://registry.npmmirror.com npm install -g pnpm
3 使用 Git Bash
为什么安装?
在 Windows 系统上运行 npm run build 时出现以下错误:
> openclaw@2026.2.25 canvas:a2ui:bundle E:\ai\aicode\traeHome\workHome\openclaw-main
> bash scripts/bundle-a2ui.sh
'bash' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
ELIFECYCLE Command failed with exit code 1.
ELIFECYCLE Command failed with exit code 1.
步骤 1:安装 Git for Windows
-
下载并运行安装程序
-
安装过程中确保选中 "Git Bash Here" 选项
-
按照默认设置完成安装
步骤 2:使用 Git Bash 运行命令
-
在项目目录
E:\ai\aicode\traeHome\workHome\openclaw-main上右键点击 -
选择 "Git Bash Here" 选项
-
在 Git Bash 终端中执行以下命令:
# 设置环境变量,使用高版本 Node.js export PATH="/e/ai/aicode/traeHome/workHome/openclaw-main/node-v24.14.0-win-x64:$PATH" # 验证 Node.js 版本 node -v npm -v # 安装依赖 npm install # 构建 UI npm run ui:build # 构建项目 npm run build # 启动开发模式 npm run gateway:watch
4 OpenClaw 的官方 GitHub 地址如下GitHub
- 主项目仓库:https://github.com/openclaw/openclawGitHub
- 组织主页:https://github.com/openclawGitHub
- 直接下载链接:https://github.com/openclaw/openclaw/archive/refs/heads/main.zip
- 手动下载入口:https://github.com/openclaw/openclaw → 点右上角 Code → Download ZIP
- 最新发布版:https://github.com/openclaw/openclaw/releases/latest → 找到 Source code (zip)
- 所有发布版列表:https://github.com/openclaw/openclaw/releases
5 编译启动
1.在E:\ai\aicode\traeHome\workHome\openclaw-main右击,选择git bash

2、 设置环境变量,使用高版本 Node.js
export PATH="/e/ai/aicode/traeHome/workHome/openclaw-main/node-v24.14.0-win-x64:$PATH"

3、验证node版本

4、pnpm install

5、pnpm ui:build

6、pnpm build

pnpm openclaw onboard --install-daemon

选择配置

配置api地址,这里我选择百炼平台的地址

配置api秘钥,这里我选择百炼平台生成的秘钥

选择模型名字

选择skill进行安装

其他参数配置,最后显示配置完毕

pnpm gateway:watch

龙虾安装成功。
C:\Users\conca\.openclaw-dev\openclaw.json从文件中找到token令牌

浏览器打开http://127.0.0.1:19001/webchat/overview,填写令牌,就可以访问聊天了。

更多推荐




所有评论(0)