使用 nvm 管理 node 版本
使用 nvm 管理 node 版本
前言
简化前端开发, 快速安装和使用不同版本的node
Linux 下安装
安装 lts
1 | sudo apt-get install curl |
基础管理命令
- 查看 node 路径:
which node - 查看 npm 路径:
which npm - 切换特定版本:
nvm use <version> - 查看本地列表:
nvm ls - 查看远程列表:
nvm ls-remote --lts - 安装特定版本
nvm install <version>
额外
加速 npm
使用淘宝镜像
1 | npm config set registry https://registry.npmmirror.com |
使用 cnpm
1 | npm install -g cnpm --registry=https://registry.npmmirror.com |