win10原生安装openclaw

  1. 下载node.js (LTS),安装在无中午路径下,D盘
    官网下载:https://nodejs.org/ (选左侧绿色 LTS);
    环境变量中添加到PATH(系统变量);
    验证:
powershell 复制代码
node -v
npm -v
  1. 下载git
    官网下载:https://git-scm.com/
    验证:
powershell 复制代码
git --version
  1. 先彻底清理以前的openclaw(复制运行)
powershell 复制代码
npm uninstall -g openclaw
rm -r "$env:USERPROFILE\openclaw" -ErrorAction SilentlyContinue
rm -r "$env:USERPROFILE\.openclaw" -ErrorAction SilentlyContinue
npm cache clean --force

7.强制安装到 D 盘纯英文路径

在D盘创建npm-global文件夹

运行:

powershell 复制代码
# 强制把全局安装位置改到 D 盘(解决中文路径)
npm config set prefix D:\npm-global

8.把 D:\npm-global 加入 PATH(必须做)

9.按实际情况选择

powershell 复制代码
# 临时把用户目录改成D盘,让安装脚本不进中文目录
$env:USERPROFILE = "D:\"

9.强制全局安装(正确方法!)

powershell 复制代码
npm install -g openclaw --registry=https://registry.npmmirror.com

10.右键 D:\npm-global\openclaw.cmd → 用记事本打开,全选删除原有内容,粘贴下面这段:

powershell 复制代码
@ECHO off
SETLOCAL
SET "OPENCLAW_ROOT=D:\npm-global\node_modules\openclaw-cn"
node "%OPENCLAW_ROOT%\dist\entry.js" %*
ENDLOCAL

11.在同目录下找到 openclaw(无后缀的文件),用记事本打开,替换为:

powershell 复制代码
#!/bin/sh
exec node "D:/npm-global/node_modules/openclaw-cn/dist/entry.js" "$@"

验证:

powershell 复制代码
# 查看 openclaw 命令位置
where.exe openclaw
# 查看 npm 全局根目录
npm root -g
# 检查 entry.js 是否存在
Test-Path "D:\npm-global\node_modules\openclaw-cn\dist\entry.js"

正常输出:

D:\npm-global\openclaw.cmd、D:\npmglobal\node_modules、True,说明配置完全正确。

12.配置model

powershell 复制代码
openclaw config

13.配置channel

14.启动

powershell 复制代码
openclaw gateway run
openclaw dashboard
相关推荐
字节跳动数据库4 小时前
文章分享——相似函数处理方法
人工智能·后端·程序员
Bigfish_coding4 小时前
前端转agent-【python】-12 LangChain 入门实战:RAG + LCEL 链式调用
人工智能
程序员cxuan4 小时前
读懂 Claude Code 架构分析系列,第一篇,开始!
人工智能·后端·架构
饼干哥哥5 小时前
扣子3.0测评:我让 Codex 和 Claude Code 住同一个桌面,结果它们打架了!
人工智能·开源·代码规范
Token炼金师5 小时前
IP-Adapter:解耦交叉注意力如何让扩散模型看见图像
人工智能
Bigfish_coding5 小时前
前端转agent-【python】-11 LangGraph 高级特性:时间旅行与人工介入
人工智能
Token炼金师5 小时前
从safetensors到像素:ComfyUI Checkpoint加载机制的底层拆解
人工智能
AI闲人5 小时前
AI 写代码越来越快,为什么 Code Review 反而更慢了?
人工智能·code review·ai 编程
武子康6 小时前
调查研究-202 SGLang 深度解析:为什么大模型推理框架不只是“把模型跑起来“
人工智能·openai·agent
我是大卫6 小时前
Trae 读取 agents.md 并驱动 AI 完整底层原理
人工智能