Ubuntu 上 Node.js 安装和卸载

1、Ubuntu 安装 Node.Js
1.1、执行检查可更新的软件:
sudo apt-get update

1.2、先用普通的apt工具安装低版本的node,然后再升级最新。
sudo apt-get install nodejs
sudo apt install nodejs-legacy
sudo apt install npm

1.3、更换淘宝的镜像,这个是必须的,用过的node的人都知道。
sudo npm config set registry https://registry.npm.taobao.org

1.4、安装更新版本的工具N,执行:
sudo npm install n -g

1.5、更新新node版本,执行:
sudo n stable

2、Ubuntu 卸载 Node.Js
sudo apt-get remove nodejs

猜你喜欢

转载自www.cnblogs.com/taony/p/10176981.html