ubuntu 20.04
适用版本 ubuntu18 - 22 应该吧安装步骤
1. 获取
node与npm这一步应该只安装一个
npm就够了,没试过,可以尝试
安装npm
sudo apt-get install npm
安装nodejs
sudo apt-get install nodejs
npm安装nsudo npm install -g n
node与npm卸载npm
sudo apt-get install npm
卸载nodejs
sudo apt-get install nodejs
n安装最新稳定版本nodesudo n latest
n 版本号
版本号可以为 latest 和 lts 如果是需要指定版本的话则为 v版本数字
在ubuntu中的apt仓库内的node版本太老旧,
但是可以使用npm来全局安装node版本管理工具来管理node版本
安装完n后就可以卸载掉通过apt安装的node,使用n来管控