3
ubuntu安装最新的node
source link: https://www.jianshu.com/p/3007c8ec64e5
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
ubuntu安装最新的node
2021.05.13 14:41:36字数 121阅读 0
更新软件源
sudo apt update
安装npm
sudo apt install npm
安装n模块
n模块是用来安装各个版本的node的一个工具,参数-g,表示全局安装
npm install n -g
安装最新长期支持版node
sudo n lts
检查安装是否成功
node -v
版本之间的切换
sudo n use [版本]
常用的一些指令
1.升级到最新稳定版
n stable
2.升级到最新版
n lastest
3.升级到定制版
n v7.10.0
4.切换使用版本
n 7.10.0
- 删除指定版本
n rm 7.10.0
6.用指定版本执行脚本
n use 7.10.0 some.js
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK