WSL2 node 与 npm 的安装
本文 nodejs
的配置适用于 WSL
,本人亲测有效(WSL Ubuntu),但是可能并不适用于其他系统。
1. 安装 nodejs
执行下列的命令,选择自己需要的版本就好了
# Node.js v13.x curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash - sudo apt-get install -y nodejs # Node.js v12.x curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - sudo apt-get install -y nodejs # Node.js v10.x curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - sudo apt-get install -y nodejs
2. 安装 npm
# 安装npm apt-get install npm
3.查看镜像
#查看当前镜像
npm config get registry
4.安装yarn
npm install -g yarn