Windows下载OpenClaw源码,启动和安装攻略
关注前端小讴原创技术文章官方文档 →安装向导1.安装node推荐版本24最低版本22.16推荐使用nvm控制node版本2.安装pnpmnpm install -g pnpm3.克隆并构建git clone https://github.com/openclaw/openclaw.gitcd openclawpnpm installpnpm ui:buildpnpm build4.链接cli让openclaw命令全局可用pnpm link --global验证命令行输入openclaw有相关提示报错及解决方法用管理员打开命令行/powershellpnpm install报错Error error code 3221225477降级node到22版本安装C构建工具下载Visual Studio Build Tools 2022运行安装器工作负载列表中只勾选“使用 C 的桌面开发”完成后需重启电脑重新install即可建议删掉node_modules和pnpm-lock.yaml并执行pnpm store prune参考方案 →pnpm build报错scripts/bundle-a2ui.sh: line 31: node: command not found创建scripts/bundle-a2ui.mjs// scripts/bundle-a2ui.mjs// OpenClaw A2UI Bundle Placeholder Generator// For public repository users who do not have access to private A2UI source code.// This script creates a minimal valid ES module to satisfy TypeScript compilation.importfsfromnode:fs;importpathfromnode:path;import{createHash}fromnode:crypto;import{fileURLToPath}fromnode:url;// ── Resolve project root directory correctly on Windows and Unix ──const__filenamefileURLToPath(import.meta.url);const__dirnamepath.dirname(__filename);constROOT_DIRpath.resolve(__dirname,..);// openclaw/ root// ── Define output paths ──constOUTPUT_DIRpath.join(ROOT_DIR,src,canvas-host,a2ui);constOUTPUT_FILEpath.join(OUTPUT_DIR,a2ui.bundle.js);constHASH_FILEpath.join(OUTPUT_DIR,.bundle.hash);// ── Ensure output directory exists ──fs.mkdirSync(OUTPUT_DIR,{recursive:true});// ── Generate placeholder content (valid ES module) ──constplaceholderContent// Auto-generated placeholder for A2UI // Source code is not available in the public OpenClaw repository. // This file exists only to satisfy build dependencies. export const A2UI { version: 0.0.0-placeholder, render: () { throw new Error(A2UI runtime is not available in this build.); } };.trim()\n;// ── Write the bundle file ──fs.writeFileSync(OUTPUT_FILE,placeholderContent);// ── Compute and write hash to prevent unnecessary rebuilds ──consthashcreateHash(sha256).update(placeholderContent).digest(hex);fs.writeFileSync(HASH_FILE,hash);// ── Success message ──console.log(✅ A2UI placeholder bundle created successfully.);console.log(Bundle:${OUTPUT_FILE});console.log(Hash:${HASH_FILE});在package.json中替换脚本{scripts:{//...canvas:a2ui:bundle:node --import tsx scripts/bundle-a2ui.mjs}}参考方案 →新手向导openclaw onboard --install-daemonI understand this is personal-by-default and shared/multi-user use requires lock-down. Continue?风险告知YesSetup mode选择配置模式QuickStartModel/auth provider选择执行模型Skip for now暂时跳过Filter models by provider选择供应商All providersDefault model默认模型Keep current验证全部显示✅即表示配置成功。启动向导1.运行诊断命令pnpm openclaw doctor依次提示“是否创建token”、“是否创建.openclaw文件夹”等均选择Yes完成后会在C:\Users\${userName}\里创建.openclaw文件夹2.配置本地网关openclaw config set gateway.mode local3.启动本地网关openclaw gateway4.在浏览器打开默认http://127.0.0.1:18789验证可在浏览器打开初始化连接界面相关配置配置文件位置C:\Users\${userName}\openclaw.json如已一键安装过OpenClaw建议备份整个.openclaw文件夹并选择性覆盖token初始化界面输入token并连接然后在控制-概览里配置网关令牌模型// openclaw.json{// ...,models:{providers:{DeepSeek:{baseUrl:xxx,// 替换即可apiKey:xxx,// 替换即可api:openai-completions,models:[{id:xx,// 替换即可name:DeepSeek-V3.2 (非思考模式),reasoning:false,input:[text],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:128000,maxTokens:8192}]}}}}
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2429519.html
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!