Use NVM to switch node version

I encountered a problem during development. To use node-sass, you need the corresponding version. Otherwise, the dependencies will not be installed and the project will not run. It is not very good to directly replace the node version. After thinking about it, I decided to use NVM to flexibly switch versions.

Install NVM

github address

Insert image description here
We directly choose nvm.setup.zip

After downloading and decompressing, you can install it directly.

You can default to it without thinking. The most important thing is to pay attention to the installation address. You may use it later.

Install/manage node version

When the installation is complete, open the command line input to view all versions installed locally. There is an optional parameter available, which displays all downloadable versions.

Insert image description here

nvm list [available]

If nvm is not a executable command... you need to configure the environment variables. (Generally speaking, he will configure it himself)

Insert image description here
After the above steps are ok, you can directly enter the command to install the corresponding version, such as: nvm install 14.21.3

nvm install 版本号

switch version

nvm use 版本号

Uninstall a version

nvm uninstall 版本号

Guess you like

Origin blog.csdn.net/weixin_44872023/article/details/131086819