系统: Ubuntu20.04
步骤
1、安装nodejs
sudo apt-get install nodejs
2、安装npm
sudo apt install npm
3、安装node更新工具
sudo npm install n -g
4、安装指定版本node
sudo n stable (指定版本 sudo n v16.13.1)
5、查看版本
sudo node --version
------------------------------------------------------------------------------------------------------------------------
nvm 管理
安装nvm:
sudo wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.39.1/install.sh | bash
nvm 管理node版本