The most comprehensive download and installation tutorial for nvm

The most comprehensive download and installation tutorial for nvm


1. What is nvm?

nvm is a node version management tool, which can easily switch, install, view, etc. the node version. Unlike npm, npm is a management tool for dependent packages.


Two, install nvm

1.nvm download address

https://github.com/coreybutler/nvm-windows/releases
提示:1.nvm-setup.zip:这是一个安装包,下载之后点击安装,无需配置就可以使用,方便。2.如果电脑上之前已经单独安装了node,先卸载
insert image description here

2. Double-click the downloaded nvm installation package

3. Check to agree, then next next step

insert image description here

4. Modify the nvm and nodejs installation directory or directly next

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

5. Install, then win+R enter cmd and press Enter, then enter the nvm command to check whether the installation is successful

提示:在刚刚的nvm文件位置打开cmd
insert image description here


3. Configure Taobao mirror source

insert image description here
Under the nvm installation path, open the settings.txt file and add the following code

node_mirror: https://npm.taobao.org/mirrors/node/
npm_mirror: https://npm.taobao.org/mirrors/npm/

insert image description here


4. Install node

1. Enter the following code to view the node version that nvm can install

nvm ls                      // 看安装的所有node.js的版本
 
nvm list available          // 查显示可以安装的所有node.js的版本

insert image description here

2. Install the corresponding version.

nvm install 版本号 // 例如:nvm install 14.20.0

insert image description here
Installing~~
insert image description here
The installation is successful

3. Switch to the installed version

nvm use 版本号           //nvm use 14.20.0  切换到使用指定的nodejs版本

insert image description here

4. Check whether the switching is completed, and open a new cmd

node -v

Five, nvm common commands

  • nvm ---- Verify that nvm is installed
  • nvm list ---- View all installed node versions
  • nvm install version number ---- install the specified version of node (npm will automatically install correspondingly) (example: nvm install 14.16.0)
  • nvm use version number----after installing node, you must remember to use this command, you can use the installed node
  • nvm uninstall version number----uninstall the specified version of node
  • nvm list available View the versions that can be installed on the network
  • nvm install installs the latest version of nvm
  • nvm root [path] set and view root path
  • nvm version View the current version
  • nvm node_mirror [url] Set or view node_mirror in setting.txt, if not set, the default is https://nodejs.org/dist/
      nvm npm_mirror [url] Set or view npm_mirror in setting.txt, if not set The default is: https://github.com/npm/npm/archive/.

6. The pits encountered

Unable to locate the program input point getHostNameW in the dynamic link library WS2_32.dll
https://blog.csdn.net/qq_35971976/article/details/128205727

Guess you like

Origin blog.csdn.net/qq_35971976/article/details/128200801