nvm installation and use

nvm install

It is recommended to use the nvm-setup installation version, which is free of configuration.
Just download the installation package and install it in a fool-like way;
open CMD, enter the command nvm, and the installation is successful, as shown below. You can see that there are various commands listed in it.

insert image description here

install/manage nodejs

1. Install the node command (when installing, npm will be installed automatically)

	nvm install  <version>  // version是版本号 	
		例如 :  nvm install 14.11.0

2. Switch node version

	nvm use  <version>   //切换到使用指定的nodejs版本
		例如 :  nvm use 14.11.0

3. Uninstall the node version

	nvm uninstall<version>   //卸载指定的nodejs版本
		例如 :  nvm uninstall 14.11.0

command prompt

  1. nvm arch : Shows whether node is running on 32-bit or 64-bit.
  2. nvm install [arch] : install node, version is the version. The optional parameter arch specifies whether to install the 32-bit or 64-bit version, and the default is the system bit. --insecure can be added to bypass SSL for remote servers.
  3. nvm list [available] : Show the list of installed ones. The optional parameter available displays all versions that can be installed. list can be simplified to ls.
  4. nvm on : Enable node.js version management.
  5. nvm off : Turn off node.js version management.
  6. nvm proxy [url] : Set download proxy. Without the optional parameter url, the current proxy is displayed. Setting url to none removes the proxy.
  7. nvm node_mirror [url] : Set node mirror. The default is https://nodejs.org/dist/. If no url is specified, the default url will be used. After setting, you can go to the settings.txt file in the installation directory to view it, or you can directly operate in this file.
  8. nvm npm_mirror [url] : Set npm mirror. https://github.com/npm/cli/archive/. If no url is specified, the default url will be used. After setting, you can go to the settings.txt file in the installation directory to view it, or you can directly operate in this file.
  9. nvm root [path] : Set the directory where different versions of node are stored; if not set, the current directory is used by default.
  10. nvm version : Display the version. version can be simplified to v.

Guess you like

Origin blog.csdn.net/weixin_44897255/article/details/108628270