The statement

First of all, I use a Windows computer, Win10, 64-bit professional edition, the reason for the pit and listen to me slowly, if there is a lack of welcome message.

The installation

  1. Download the installation package, the link, the official website address, select NVM-setup. zip, and then install it. The default is disk C. I used to manually select another disk, then need to configure those environment variables and so on.

Change the directory name manually. 2. Configure environment variables.This step can be ignored for now, but check to see if it already existsNVM_HOME is on NVM_SYMLINK by default and must be on NVM_SYMLINKCheck the environment variable Path. If it does not exist, manually add the following

%NVM_HOME%; %NVM_SYMLINK%Copy the code

3. Before verifying the installation, restart the PC and run the NVM -v command. If a similar message is displayed, the installation is successful.If the image above does not appear and the command does not exist, the computer must restart,Be sure to restart your computer

  1. Modify the NVM configuration file and don’t rush to install Node

Go to your installed NVM directory, which is the directory you selected in the first step of installation. Mine is drive CDev/NVM, select settings. TXT file to edit, set download node and NPM taobao image,This taobao image is the taobao image of node and NPM download, not the image of NPM plugin dependency package downloadAnd then save

root: C:\dev\nvm
path: C:\Program Files\nodejs
arch: 64
proxy: none
node_mirror: https://npm.taobao.org/mirrors/node/
npm_mirror: https://npm.taobao.org/mirrors/npm/
Copy the code

The taobao image command you want to set to download the NPM plugin dependency package is

npm config set registry https:/ / registry.npm.taobao.org/ / / taobao image
npm config set registry https://registry.npmjs.org/ // default image
Copy the code
  1. After configuring these, I installed the specified version directly. I was learning VUE and required to use the latest LTS, and then I stomped out these holes.
// The default is 64 bits
nvm install 12.184. 
// The specified version is
nvm install 12.184. 32  / / or 64
Copy the code

After downloading the software, install the current version directly. Otherwise, the version switchover may fail.

nvm use 12.184.
Copy the code

In Windows, an asterisk (*) indicates the current node version, as shown in the figure

nvm ls
Copy the code

6. Common commands

nvm -v // Check the NVM version and usage instructions as NVM help
nvm ls-remote // List all remote server versions (official Node version list)
nvm ls // Check the list of node versions that have been downloaded. * indicates the current version
nvm current // Check the current node versionNVM install < version >// Download and install nodeNVM uninstall < version number >// Uninstall the Node versionNVM use < version number >// Set the version, the prerequisite must be downloaded
Copy the code

End and spend

In fact, this gadget is still very easy to use, is the previous installation of the way there is a problem, there is no direct download of the successful version switch. Give it a thumbs up when you see this