preface

The goal of this tutorial is to implement an NVM managed node on a Window

The body of the

If you already have Node installed, you need to uninstall node first. If you have not installed node, skip this step to the next step

To see if we have node installed, open your terminal and type to see if node is installed

node -v
Copy the code

Open control Panel => Open Programs and functions => Search in the upper right corner type node => Programs and functions to find NDOE

Right-click and uninstall the node

Look again at node

node -v
Copy the code

You can see that the node has been uninstalled. To ensure that the node is completely deleted, make sure to delete the following files

  • The default node installation directory is C:\Program Files
  • C:\Users\ user name folder. NPMRC and. Yarnrc and so on all delete
  • Check to see if your environment variables are nDOE related, and delete them if they are

Install the NVM

1. Go to Github and download the latest NVM. Go to nvM-setup.zip and click download

2. Decompress the installation package

3. Double-click to install it to the default directory

NVM installation path

4. Select the node installation path

Node Installation Path

5. The installation is complete

Install the end

6. Check whether the installation is successful

nvm version
Copy the code

If the version number appears successfully, congratulations on the NVM installation

  1. Configure the mirror

The original image is slow and even causes node download failure. Let’s configure the domestic image

Open our NVM installation directory and go to settings.txt

Double-click open in the back to add taobao source address, and then save

node_mirror: https://npm.taobao.org/mirrors/node/
npm_mirror: https://npm.taobao.org/mirrors/npm/
Copy the code

At this point, we are done installing NVM.

Install NDOE

1. Open the node official website to view the latest version and copy the latest version

Install the version of Node you copied

NVM install 14.15.1Copy the code

View the list of nodes in NVM

nvm list
Copy the code

Change the node version. NVM use is followed by the version number

NVM use 14.15.1Copy the code

Looking again at the node list in NVM, you can see that the version number is preceded by an asterisk (*). This asterisk is your current node version

nvm list
Copy the code

Looking at the current node version and NPM version, you can see that our current node is 14.15.1 and NPM is 6.14.8

node -v
npm -v
Copy the code

10. If you want to install another version, go to the Node official website to check the historical version

Node Historical version

At the end

This will enable you to successfully install the desired version of node using NVM, and you can switch between node versions at any time. No longer have to worry about someone asking us to maintain some old project when we don’t have a version of Node

The resources

[# version more NVM nodejs management tool is introduced and the use of] NVM (www.tensweets.com/a# more nodejs version management tool is introduced and using the rticle / 5 bafb7aef0cb0c04f86b23ed)