- 下载和安装git以及node 22(一定要node22,也就是我提供的安装包或者自己去找,最新的node24会导致下载失败),这里必须傻瓜式安装,也就是安装到c盘
- 设置git 环境变量和更改执行策略
setx PATH "%PATH%;C:\Program Files\Git\bin" /M 添加git的环境变量
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser 修改策略为执行npm做准备(npm是node的包管理器)
3. 使用node的包管理器npm来安装openclaw
npm install -g openclaw --ignore-scripts --registry=https://registry.npmmirror.com
openclaw --version #验证是否安装成功
openclaw onboard --install-daemon --non-interactive --accept-risk
openclaw plugins enable qwen-portal-auth
openclaw models auth login --provider qwen-portal --set-default #登录,这会打开浏览器,而后登录千问
openclaw dashboard
openclaw gateway start
- 在浏览器中访问:
http://127.0.0.1:18789/chat?session=main就能正常使用啦
- 出现openclaw无法被识别的问题,用下面方法解决
npm config get prefix 先输出一个npm安装位置,用来替代C:\Users\用户名\AppData\Roaming\npm
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Users\用户名\AppData\Roaming\npm", "User")