[NVM] Use NVM to realize free switching between different nodejs versions (NVM installation tutorial manual):


1. Download of NVM

注意路径不要出现中文和空格
Installation package address: https://github.com/coreybutler/nvm-windows/releases
insert image description here

2. NVM installation

insert image description here
insert image description here
insert image description here
insert image description here

3. Use of NVM

注意:nvm needs system administrator privileges when switching node versions, so you need to open the command line window as an administrator! ! !

1. Set up the nvm environment
nvm node_mirror https://npm.taobao.org/mirrors/node/
nvm npm_mirror https://npm.taobao.org/mirrors/npm/

insert image description here

2. Install nodejs

insert image description here

3. Use or switch nodejs version

insert image description here

4. Suggestions

insert image description here

npm config set prefix E:\dev\nvm\npm
npm config set cache E:\dev\nvm\npm\node_cache

insert image description here
insert image description here

Five, nvm command summary

  1. nvm arch: Shows whether node is running on 32-bit or 64-bit.
  2. nvm install <version> [arch] : Install node, version is a specific version or the latest stable version latest. 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]: Display the installed list. 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 mirroring. 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 up npm mirroring. 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 uninstall <version>: Uninstall the specified version node.
  10. nvm use [version] [arch]: Use the specified version node. 32/64 bits can be specified.
  11. nvm root [path]: Set the directory where different versions of node are stored. If not set, the current directory is used by default.
  12. nvm version: Display nvm version. version can be simplified to v.

Guess you like

Origin blog.csdn.net/weixin_53791978/article/details/130283112
NVM