Switching between multiple Node.js versions_How to have multiple Node.js versions at the same time_Installing nvm (Windows10 operation)

First, delete node.js, uninstall it cleanly
, and then install nvm (node ​​version management tool)

1. Download
Download link: https://github.com/coreybutler/nvm-windows/releases

Pull down to find the place to download
insert image description here
nvm-noinstall.zip: It is not recommended to install without installation. I have not configured it well. It has been a long time.
nvm-setup.zip: The installation version is recommended.

2. Installation
attention: installation warning! ! !
By default, this path C:\Program Fileshas spaces in it! There should be no Chinese and spaces
in the file name , so the entire plain English here does not have any spaces

This is my directory path
insert image description here
1. Double-click nvm-setup.exe
insert image description here
2. Accept the agreement
insert image description here
3. Select the installation path of nvm
insert image description here

4. Select the nodeks installation path
insert image description here
5. Confirm the installation
insert image description here
and check whether the installation is successful. Window+R input cmd
insert image description here
input nvmwill display the installation version and related commands.
insert image description here
At this time, the nvm installation is successful. Now you can install different node.js installations. You need to install from the lower version

3. Start using nvm
1. nvm listCommand - display version list

nvm list // 显示已安装的版本(同 nvm list installed)
nvm list installed // 显示已安装的版本
nvm list available // 显示所有可以下载的版本

2. nvm install xx.x.xCommand - install the specified version node.js

nvm install 14.5.0 // 安装14.5.0版本node
nvm install latest // 安装最新版本node

3. nvm useCommand - use the specified version node

nvm use 14.5.0 // 使用14.5.0版本node

4. uvm unistallCommand - Uninstall the specified version node

nvm uninstall 14.5.0 // 卸载14.5.0版本node

5. This is what I am currently using.
insert image description here
6. nvm onTurn on node.js version management.
I don’t know why there are garbled characters after typing, but it doesn’t affect it.

Reference: If you have any questions, you can click the
link

4. Configure the environment (this is what I added separately in case there are friends who can’t configure the environment like me)

1. Find the environment configuration place like I can’t find it. sysdm.cpl
insert image description here
2. Enter the environment variable 3. Create a new variable name
insert image description here
in the following system variables : NODE_PATH variable value: your node.js version number there 4. In the red box 5. Edit in the Path in the above user variable 6. Create a new one like me and come out 7. Confirm and save all the way. Finally, test whether the node is configured in cmd. If you need to switch to another version Just change it in this variable path. I read others that you can use nvm to switch the variable path to switch versions, but I am in a hurry here, so I didn’t check it. If anyone knows, please let me know. Thank you very much.
insert image description here


insert image description here

insert image description here

insert image description here

insert image description here

node-v
insert image description here

insert image description here

Guess you like

Origin blog.csdn.net/weixin_47336389/article/details/125619786