Windows uses nvm to install node and error handling

1. Download

https://github.com/coreybutler/nvm-windows/releases

Recommended download nvm-setup.zipfor easier operation in the future
Insert image description here

2. Installation

1. Double-click the decompressed filenvm-setup.zip

Insert image description here

2. Select nvmthe installation path,Note that you must choose a path that is all in English, without Chinese characters and spaces., otherwise an error will be reported if used later.

Insert image description here

3. Select node.jsthe installation path

Insert image description here

4. Confirm installation

Insert image description here

5. If a version has been installed before node, a pop-up will pop up to control nodewhether to join a version that already exists nvm. Just select "Yes" at this time; if it has not been installed before node, ignore this

Insert image description here

6. Installation successful

Insert image description here

3. Use

1. Use nvm listto view the installed nodeversion

Insert image description here

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

2. Use to nvm installinstall the specified nodeversion

Note that if you install it directly using nvm install, it will be very, very slow. It is recommended to switch the installation source of nvm to Taobao source, which will make the installation much faster.

  • Command line input where nvm
  • Find settings.txt in the prompt directory
  • Add Taobao image later:
node_mirror: https://npm.taobao.org/mirrors/node/
npm_mirror: https://npm.taobao.org/mirrors/npm/

As shown in the picture:
Insert image description here

3. Use nvm useto specify the current nodeversion

First use nvm listto view the current node version, we can see that there are currently three versions
Insert image description here

Use nvm use 14.20.1to switch to this versionNote: The following error will be reported at this time. This is because cmd is not run as an administrator. Just run it as an administrator again.
Insert image description here
exit status 5: �ܾ����ʡ�
exit status 1: ���ļ��Ѵ���ʱ���޷��������ļ���

Insert image description here

Run as administrator cmd , switch nodeversion successfully
Insert image description here

Finished~~~~Spread flowers

This article refers to https://www.jianshu.com/p/13c0b3ca7c71

Guess you like

Origin blog.csdn.net/weixin_44157964/article/details/127069029