nvm manages multiple node versions

solve

nvm is a nodejs version management tool. Through it, different versions of nodejs can be installed and switched to solve the incompatibility of various versions of node. But you need to uninstall the previous nodejs before installing

download

Click here to download the latest version .
nvm-noinstall.zip: Green free installation version, but configuration is required when using it.
nvm-setup.zip: installation version, recommended.
Source code(zip): zip compressed source code.
Sourc code(tar.gz): The source code of tar.gz, generally used in *nix systems.

installation

  • Uninstall existing node
      Please note that you need to uninstall any existing node.js version before installing NVM for Windows. Also delete all existing nodejs installation directories that may remain (for example, "C:\Program Files\nodejs"). The symbolic links generated by NVM will not overwrite the existing (or even empty) installation directory.
  • To uninstall the existing npm
      you should also delete the existing npm installation location (for example "C:\Users\<user>\AppData\Roaming\npm") in order to use the nvm installation location correctly.
  • Click the installation package to install
    Alt
  • Select nvm installation path
    Alt
  • Select nodejs path
    Alt
  • Confirm the installation
    Alt

Configure environment variables

Alt

  • Open CMD, enter the command nvm, the installation is successful, it will be displayed as follows. List the commands used by nvm
  • Alt
nvm arch [32|64]:显示节点是否以32位或64位模式运行。指定3264以覆盖默认体系结构。
nvm install <version> [arch]:该版本可以是node.js版本,也可以是最新的稳定版本的“最新”版本。(可选)指定安装32位还是64位版本(默认为系统体系结构)。设置[arch]为“全部”以安装3264位版本。
nvm list [available]:列出node.js安装。available在末尾键入以显示可供下载的版本列表。
nvm on:启用node.js版本管理。
nvm off:禁用node.js版本管理(不卸载任何内容)。
nvm proxy [url]:设置用于下载的代理。留[url]空白,以查看当前的代理。设置[url]为“无”以删除代理。
nvm uninstall <version>:卸载特定版本。
nvm use <version> [arch]:切换为使用指定的版本。(可选)指定32/64位体系结构。nvm use <arch>将继续使用所选版本,但根据提供给的值切换到32/64位模式<arch>。
nvm root <path>:设置nvm应在其中存储不同版本的node.js的目录。如果<path>未设置,将显示当前根目录。
nvm version:显示NVM for Windows的当前运行版本。
nvm node_mirror <node_mirror_url>:设置节点镜像。建议使用淘宝镜像 https://npm.taobao.org/mirrors/node/
nvm npm_mirror <npm_mirror_url>:设置npm镜像。建议使用淘宝镜像 https://npm.taobao.org/mirrors/npm/
也可以在安装的目录下找到settings.txt文件打开后加上
node_mirror: https://npm.taobao.org/mirrors/node/
npm_mirror: https://npm.taobao.org/mirrors/npm/  使用淘宝镜像,可以提高下载速度

Guess you like

Origin blog.csdn.net/weixin_44714325/article/details/107352813