Basic use of NVM

1. What is nvm?

nvm is a node version management tool, which can easily switch, install and view node versions. . . Wait, unlike npm, npm is a management tool for dependent packages.

Two, nvm download and install

Before installing, you need to uninstall the node on your computer!!!! Very important

URL: https://github.com/coreybutler/nvm-windows/releases

Unzip the nvm-setup.zip installation package, enter the unzipped folder, double-click the exe suffix file to install

This interface is to choose the path to install nvm. You can change the installation path by yourself. Generally, the default path

This is the node installation location. The default is fine. The node folder will be automatically generated.

After the installation is complete, enter nvm -v to view the version.

3. The use of nvm

After the installation is complete, find the installation path, some simple configuration, and open the setting.txt (it will automatically generate npm for you after the download is complete, and you don’t need to install npm repeatedly after downloading the node package)

Add these two strings of things in the back

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

After the addition is complete, it looks like this

 Instructions for nvm

nvm off                     // 禁用node.js版本管理(不卸载任何东西)
nvm on                      // 启用node.js版本管理
nvm install <version>       // 安装node.js的命名 version是版本号 例如:nvm install 8.12.0
nvm uninstall <version>     // 卸载node.js是的命令,卸载指定版本的nodejs,当安装失败时卸载使用
nvm ls                      // 显示所有安装的node.js版本
nvm list available          // 显示可以安装的所有node.js的版本
nvm use <version>           // 切换到使用指定的nodejs版本
nvm v                       // 显示nvm版本
nvm install stable          // 安装最新稳定版

Open the console nvm list available to view the installable version

Command input nvm install <version number>

 

After successful installation nvm ls to view the installed node version 

nvm use <version number> switch node version

 node -v Check whether the node switch is successful (the lower part indicates that the switch is successful)

npm -v to see if npm is installed (successful installation)

Then we run the project (OK started successfully)

Guess you like

Origin blog.csdn.net/m0_65634497/article/details/127789013