小龙虾的风都吹了挺久,一直没时间安装,自媒体铺天盖地的夸赞,感觉自己不安装个小龙虾就要被时代淘汰了[狗头],其实也没想好在什么场景应用,但周末刚好空闲就打算安装一个先玩玩!打算在Windows系统安装,OpenClaw 官方推荐使用 WSL2 + Ubuntu 来安装(原生 Windows 安装不稳定),过程看起来其实很简单,但第一次安装也会遇到一些小问题,先简单记录一下,后面有时间可能也会整理一下完整安装流程笔记吧

一、在Ubuntu中通过npm安装 OpenClaw,网络波动安装过程失败异常
openclaw@DESKTOP-M1Q0S9R:~$ sudo npm install -g openclaw@latest
[sudo] password for openclaw:
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
npm error code ETIMEDOUT
npm error syscall read
npm error errno -110
npm error network read ETIMEDOUT
npm error network This is a problem related to network connectivity.
npm error network In most cases you are behind a proxy or have bad network settings.
npm error network
npm error network If you are behind a proxy, please make sure that the
npm error network 'proxy' config is set properly.  See: 'npm help config'
npm notice
npm notice New major version of npm available! 10.9.4 -> 11.12.1
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.12.1
npm notice To update run: npm install -g npm@11.12.1
npm notice
npm error A complete log of this run can be found in: /root/.npm/_logs/2026-03-28T14_28_26_561Z-debug-0.log

设置新的npm源即可

openclaw@DESKTOP-M1Q0S9R:~$ npm config get proxy
null
openclaw@DESKTOP-M1Q0S9R:~$ npm config get https-proxy
null
openclaw@DESKTOP-M1Q0S9R:~$ npm config get registry
https://registry.npmjs.org/
openclaw@DESKTOP-M1Q0S9R:~$ npm config set registry https://registry.npmmirror.com
openclaw@DESKTOP-M1Q0S9R:~$ npm config get registry
https://registry.npmmirror.com
二、用户目录权限问题

前面用sudo npm 安装OpenClaw过程中失败后,再次安装没加sudo导致无权限失败

openclaw@DESKTOP-M1Q0S9R:~$ npm install -g openclaw@latest
npm error code EACCES
npm error syscall mkdir
npm error path /usr/lib/node_modules/openclaw
npm error errno -13
npm error Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/openclaw'
npm error     at async mkdir (node:internal/fs/promises:855:10)
npm error     at async /usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:624:20
npm error     at async Promise.allSettled (index 0)
npm error     at async [reifyPackages] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:325:11)
npm error     at async Arborist.reify (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:142:5)
npm error     at async Install.exec (/usr/lib/node_modules/npm/lib/commands/install.js:150:5)
npm error     at async Npm.exec (/usr/lib/node_modules/npm/lib/npm.js:207:9)
npm error     at async module.exports (/usr/lib/node_modules/npm/lib/cli/entry.js:74:5) {
npm error   errno: -13,
npm error   code: 'EACCES',
npm error   syscall: 'mkdir',
npm error   path: '/usr/lib/node_modules/openclaw'

只能用回原来的sudo权限模式安装才成功,虽然是小问题但一开始就确定用哪个用户权限安装就比较好

openclaw@DESKTOP-M1Q0S9R:~$ sudo npm install -g openclaw@latest
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead

added 459 packages in 10m

84 packages are looking for funding
  run `npm fund` for details
三、Windows + WSL2 + 代-理联动的设置

安装过程中即使Windows 使用了开心上网工具,WSL 里 curl google.com却网络响应异常,可以开启 Mirrored Networking + autoProxy,通过设置 .wslconfig ,放到c:\用户\用户名下(每个人用户名大概率不一样)

四、待续

……

Logo

小龙虾开发者社区是 CSDN 旗下专注 OpenClaw 生态的官方阵地,聚焦技能开发、插件实践与部署教程,为开发者提供可直接落地的方案、工具与交流平台,助力高效构建与落地 AI 应用

更多推荐