当前位置:网站首页>【Node】nvm 版本管理工具
【Node】nvm 版本管理工具
2022-07-05 07:07:00 【嘻嘻的妙妙屋】
nvm
概念
nvm 全名 node.js version management,顾名思义是一个nodejs的版本管理工具。通过它可以安装和切换不同版本的nodejs。
下载
打开网址我们可以看到有两个版本:
- nvm-noinstall.zip:绿色免安装版,但使用时需进行配置。
- nvm-setup.zip:安装版,推荐使用
下载安装完毕后,打开CMD,输入命令 nvm,安装成功则如下显示,可以看到里面列出了各种命令。
安装 / 管理 nodejs
- 查看本地安装的所有版本;有可选参数available,显示所有可下载的版本。
nvm list [available]
- 安装,命令中的版本号可自定义。
nvm install 16.15.0
- 使用特定版本
nvm use 16.15.0
- 卸载
nvm uninstall 16.15.0
补充
No installations recognized
如果在安装 nvm 之前已经安装了Node.js,安装之后,使用 nvm list
命令本应该会列出之前已经安装的版本号,但却出现了 No installations recognized
提示,意为没有安装的版本。
网上说是因为在安装 nvm 之前要卸载已经安装的 node 版本,一定要卸载干净。我就不一样了,我懒得卸载,于是我通过 node -v
知道我自己本机的版本之后 nvm install
了一个一模一样的版本,这样它就能检测到了
然后你以为这就可以了?并不,我 nvm use
的时候发现它乱码了,网上又说用管理员模式运行 cmd 就可以,我试了还是不行,于是我乖乖的把 nvm 和 node 都卸载了,然后重新装了一次 nvm,在上面下载各种版本的 node,就可以了,emmm,人还是不能太懒
设置国内镜像
在 nvm install
时下载太慢,可以设置 nvm 国内镜像:
阿里云
# 设置npm_mirror:
nvm npm_mirror https://npmmirror.com/mirrors/npm/
# 设置node_mirror:
nvm node_mirror https://npmmirror.com/mirrors/node/
腾讯云
# 设置npm_mirror:
nvm npm_mirror http://mirrors.cloud.tencent.com/npm/
# 设置node_mirror:
nvm node_mirror http://mirrors.cloud.tencent.com/nodejs-release/
然后就可以体验飞起来的感觉了!
边栏推荐
- . Net core stepping on the pit practice
- 【软件测试】02 -- 软件缺陷管理
- Instruction execution time
- Mutual transformation between two-dimensional array and sparse array (sparse matrix)
- Database mysql all
- Integer to 8-bit binary explanation (including positive and negative numbers) scope of application -127~+127
- ROS2——安装ROS2(三)
- Orin installs CUDA environment
- Binary search (half search)
- C#学习笔记
猜你喜欢
Positive height system
Netease to B, soft outside, hard in
Ros2 - configuration development environment (V)
并发编程 — 如何中断/停止一个运行中的线程?
【软件测试】04 -- 软件测试与软件开发
ethtool 原理介绍和解决网卡丢包排查思路(附ethtool源码下载)
ROS2——初识ROS2(一)
Orin 两种刷机方式
[algorithm post interview] interview questions of a small factory
扫盲-以太网MII接口类型大全-MII、RMII、SMII、GMII、RGMII、SGMII、XGMII、XAUI、RXAUI
随机推荐
Skywalking全部
三体目标管理笔记
Markdown syntax
Get class files and attributes by reflection
数学分析_笔记_第8章:重积分
Dameng database all
Netease to B, soft outside, hard in
SRE核心体系了解
Concurrent programming - deadlock troubleshooting and handling
2022年中纪实 -- 一个普通人的经历
What is linting
Vant weapp swippecell set multiple buttons
6-3 find the table length of the linked table
Rehabilitation type force deduction brush question notes D1
Xiaomi written test real question 1
ROS2——topic话题(八)
全局变量和静态变量的初始化
Rehabilitation type force deduction brush question notes D3
SOC_SD_CMD_FSM
Executealways of unity is replacing executeineditmode