OpenClaw | Windows11养虾日记1-安装OpenClaw

OpenClaw | Windows11养虾日记1-安装OpenClaw step1:安装WSL2和Ubuntu这一部分主要参考自csdn博主文章WSL2 是 Windows Subsystem for Linux。先决条件:勾选控制面板中Windows功能中的以下选项然后在CMD中安装WSLwsl--install微软安装官方文档wsl--list--online选择Ubuntu 22.04wsl.exe--install-d Ubuntu-22.04 2在这里遇到了几个小问题1.MobalXterm中文乱码解决方案2.WSL报 不存在具有提供的名称的分布解决方案3.Win11安装Ubuntu子系统报错WslRegisterDistribution failed with error: 0x800701bc :解决方案step2:安装OpenClaw有了Ubuntu自己设置用户名密码就开干了。在Ubuntu 命令行中敲入curl-fsSL https://openclaw.ai/install.sh|bash这里看起来一切都很顺利直到……Install plan OS: linux Install method: npm Requested version: latest[1/3]Preparing environment ✓ Node.js v22.22.1 found · Active Node.js: v22.22.1(/usr/bin/node)· Active npm: 10.9.4(/usr/bin/npm)[2/3]Installing OpenClaw ✓ Git already installed · Installing OpenClaw v2026.3.8!npm install failedforopenclawlatest Command: env SHARP_IGNORE_GLOBAL_LIBVIPS1 npm--loglevel error--silent--no-fund--no-audit install-g openclawlatest Installer log:/tmp/tmp.h8HTtCbwbg!npm install failed;showing last log lines!npm install failed;retrying!npm install failedforopenclawlatest Command: env SHARP_IGNORE_GLOBAL_LIBVIPS1 npm--loglevel error--silent--no-fund--no-audit install-g openclawlatest Installer log:/tmp/tmp.if8ZiIreCg!npm install failed;showing last log lines这个问题我通过所有市面上的AI回答的方法包括所谓绕过Github、用镜像、用Gitee甚至代码仓都已经不存在了都不行。请教同事最后借助科学上网。归结在WSL里没有获取到外面Windows的网络环境需要改一下WSL2的配置。首先是1.在C:\Users\Administrator里创建.wslconfig文件。可以新建一个txt文件然后将后缀名修改为.wslconfig2.这个文件里面写一下[experimental]networkingModemirrored3.到WSL2里去更新版本。使用wsl--update//更新WSL2版本 wsl--shutdown//关闭原来的WSL 使得新版本重新奏效 wsl--version//检查WSL2版本号确认是最新版本后回到WSL-Ubuntu里4.在WSL-Ubuntu里使用ip addr确认mirror是否奏效。看看当前ip是多少export https_proxyhttp://127.0.0.1:7897试一下Google行不行得通curl https://www.google.com可以的话就可以去安装龙虾了curl-fsSL https://openclaw.ai/install.sh|bash