查看当前已安系统

wsl --list --verbose

安装系统

wsl --install Ubuntu-24.04

设置默认启动系统

wsl --set-default Ubuntu-24.04

wsl启动
cp /etc/apt/sources.list /etc/apt/sources.list.backup
vi /etc/apt/sources.list
输入阿里云的镜像源

阿里云 Ubuntu 24.04 LTS 镜像源

deb https://mirrors.aliyun.com/ubuntu/ noble main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ noble-updates main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ noble-backports main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe multiverse
输入wq保存退出
apt update
apt install net-tools
apt install build-essential git cmake python3 -y

克隆仓库

git clone https://github.com/emscripten-core/emsdk.git

进入目录

cd emsdk

安装最新版工具链

./emsdk install latest

激活环境变量

./emsdk activate latest
source ./emsdk_env.sh

验证安装

emcc --version

安装nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
source ~/.bashrc


懒熊工作室
94 声望4 粉丝