nvm: node package manager installation and use

The full name of nvm is nodejs version manage, which is a version management tool for nodejs.

  1. Before installing nvm, you must delete nodejs on the computer to avoid subsequent installation failures (the environment variables must also be deleted).

  1. nvm download address: Releases coreybutler/nvm-windows (github.com)

  1. Unzip => Install

  1. Run cmd after successful installation

If the above situation occurs, the installation is successful!!!

  1. configuration file

Add the following two lines of code to set the Taobao mirror source:

node_mirror: https://npm.taobao.org/mirrors/node/
npm_mirror: https://npm.taobao.org/mirrors/npm/
  1. nvm use command

// 查看可下载的nodejs版本号
nvm list available
// 查看已安装的nodejs版本
nvm list
// 需要安装nodejs版本 nvm install xx.xx.x
nvm install 14.21.1 
// 使用该版本
nvm use 14.21.1
// 卸载nodejs版本
nvm uninstall 14.21.1
nvm arch                 显示node是运行在32位还是64位
nvm version              显示nvm版本号
nvm install 版本号       安装该版本号的nodejs
nvm uninstall 版本号     卸载该版本的nodejs
nvm use 版本号           使用该版本的nodejs
nvm list                 查看已安装的nodejs版本
nvm list available       显示可下载的nodejs版本号
nvm on                   开启nodejs版本管理
nvm off                  关闭nodejs版本管理
nvm proxy [url]          设置下载代理,不添加url,显示当前代理,将url设置为none时则移除代理
nvm node_mirror [url]    设置node镜像,默认url是https://nodejs.org/dist/,设置url后可在安装nvm的目录下settings.txt文件查看,也可操作
nvm npm_mirror [url]     设置npm 镜像,默认url是https://github.com/npm/cli/archive,设置url后可在nvm目录下settings.txt文件查看,也可操作
nvm root [path]          设置存储不同版本的nodejs目录,如未设置,默认使用当前目录

Guess you like

Origin blog.csdn.net/m0_58293192/article/details/128785396