开启左侧

WSL2 环境下快速搭建 OpenClaw

[复制链接]
作者:CSDN博客
OpenClaw 官方主要推荐在 WSL2 (Windows Subsystem for Linux) 环境下运行,而在原生 Windows (Native Windows) 上运行可能会遇到兼容性问题。
一、安装 WSL2 (Ubuntu 20.04)

1)使用命令行自动安装
在 PowerShell 中运行,或者如果想要更新的版本,使用wsl --install -d Ubuntu-22.04
(base) PS C:\Users\liu_l> wsl --install -d Ubuntu-20.04正在启动 Ubuntu 20.04 LTS...Installing, this may take a few minutes...(2)初始化新的 Ubuntu
1、它会显示 Installing, this may take a few minutes...
2、然后提示输入 新的 UNIX 用户名 (Username)。
    输入名字(比如 liu),回车。
    注意:这里输入的用户名和 Windows 用户名可以不同。
3、提示输入 密码 (Password)。
    输入密码,回车。
    重要提示:Linux 下输入密码时屏幕上不会显示任何字符,输完直接回车即可。
4、再次输入密码确认。
看到 liu@computer-name:~$ 这样的提示符,说明安装成功了!
二、在新的 WSL 中安装 OpenClaw

在新的 Ubuntu 终端中,依次执行:
(1)更新系统并安装 Node.js (v22),node.js的版本不要低于v22。
sudo apt update && sudo apt upgrade -ysudo apt install -y curl git​# 安装 Node.js 22curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -sudo apt-get install -y nodejs​# 验证node -v  # 应显示 v22.x.x(2)安装 OpenClaw
sudo npm install -g openclaw@latest如果出现下面的内容,即可说明安装成功:
liu@LEGION:~$ sudo npm install -g openclaw@latestnpm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead...npm warn deprecated tar@6.2.1: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me...npm warn deprecated tar@6.2.1: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me​added 701 packages in 28m​128 packages are looking for funding  run `npm fund` for details三、配置OpenClaw并启动服务

(1)配置服务
liu@LEGION:~$ openclaw configure​
WSL2 环境下快速搭建 OpenClaw-1.png
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

发布主题
阅读排行更多+

Powered by Discuz! X3.4© 2001-2013 Discuz Team.( 京ICP备17022993号-3 )