It is really convenient to use nvm to manage the version of node.js, so that you can switch the version of node.js back and forth according to your own needs!
1. Uninstall the locally installed node.js version
slightly
2. Install the nvm management tool
2.1. Download
https://github.com/coreybutler/nvm-windows/releases
2.2 Installation
(1) Double-click the nvm-setup.exe file, select the "I accept..." line, and click next
(2) You can customize the path disk according to your own situation. There should be no spaces or Chinese symbols in the path (the path should preferably be in the root directory of the path disk, such as the root directory under the C disk and D disk). I choose the D disk myself Root directory. After selection, click next
(3) Select the installation location of node.js, and you can customize the path disk according to your own situation. There should be no spaces or Chinese symbols in the path (the path is best to create a new folder under the root directory of the path disk, such as C drive, D The root directory under the disk), I create a nodejs folder under the root directory of the D disk myself. After selection, click next
(4) The last step, click install to complete the installation
3. Verification
(1) Press win+R to pop up a window, enter cmd on the keyboard, and then press Enter
(2) Enter the command to check, if the version number appears, the installation is successful
nvm v
4. Install node.js
(1) Press win+R to pop up a window, enter cmd on the keyboard, and then press Enter
(2) Enter the command to view the available node.js version number
nvm list available
(3) Install the required version
nvm install 12.17.0
Note: In addition to the node.js version shown above, other version numbers can also be downloaded, but some can be downloaded accurately, and some npm versions will not be downloaded automatically.
(4) Verify that if the version number is displayed, the installation is successful.
Check out node.js
node -v
test-npm
npm -v
(5) Use node. js
nvm use 12.17.0
5. Manage node.js
5.1. View the installed version number
nvm ls
5.2 Delete a version number
nvm uninstall 版本号