The simplest and crudest way to upgrade node is to download the msi file and replace it in the node installation path.
However, the company needs to go through an approval process to install the software, which takes a long time and is very troublesome. I just wanted to do a command line upgrade, so I discovered gnvm , which is useful for personal testing.
gnvm website: http://ksria.com/gnvm/
The official website provides various download methods:
Then, gnvm is used in this way, just put the gnvm.exe file in the same directory of the node installation path.
Open cmd and perform the relevant operations according to what you need (the official website has an introduction, so I won’t outline them one by one). The following is an introduction to its functions and the supported commands gnvm website
: http://ksria.com/ gnvm/
function introduction:
config 配置 .gnvmrc
use 使用某个本地已存在的 Node.js 版本
ls 输出 [local] [remote] Node.js 版本
install 下载/安装任意已知版本的 Node.js
uninstall 删除任意本地已存在的 Node.js
update 下载 Node.js latest 版本并更新到 .gnvmrc 里面
npm NPM 下载/安装/删除 管理
session 临时设定本地某个已存在的 Node.js 为 全局 Node.js
search 查询并且输出符合查询条件的 Node.js 版本详细信息的列表
node-version 输出 [global] [latest] Node.js 版本
reg 设定 .gnvmrc 属性值 [noderoot] 为 环境变量 [NODE_HOME],并加入到 Path 中
version 查看 gnvm 版本
Install version 14.15.0
gnvm install 14.15.0-x64
Here are several node versions installed by myself
Update the corresponding npm version
npm install [email protected] -g