NVM download and install to avoid pitfalls (super detailed / with error resolution)

NVM download (points to note)

1. There will be more pitfalls when downloading nvm. To be on the safe side, it is recommended to download version 1.1.7
. If you configure environment variables, first clear the relevant environment variables)
3, then create a new folder nodeJS under the drive letter of the D drive
4, and then start the nvm installation. The first path selection during the installation process is the installation path of nvm. It is recommended to choose D 5 under the drive letter
, the second path is the path to install nodejs, select the path 6 of the nodeJS file I asked you to create above,
after the download is complete, first check the version and enter the cmd window (enter as an administrator), enter nvm -v View version
7, and then find the nvm folder after installation, go into it and find settings.txt and add the following code (Taobao mirror address, so downloading node is faster)

arch: 64
proxy: none
node_mirror: https://npm.taobao.org/mirrors/node/
npm_mirror: https://npm.taobao.org/mirrors/npm/

8. Download the node version you need

nvm install   ...node版本号

It is recommended to start downloading from the lower version and download the first one first

nvm use 你刚刚下载的那个版本号 //代表使用当前node版本

Then check it, the version with * in front of it means the setting is successful

nvm ls //查看node版本列表,及当前使用的版本

Finally, don’t forget to download your previous node version, so that switching back will not affect your previous project, and it can run normally)
9. There may be problems after downloading, npm i or cnpm i can’t be used, because the previous node Uninstalled, your Taobao mirror cannot be used, or there is a problem with the agent. If there is a problem, we will execute the following commands in sequence at this time. If there is no problem, do not execute the first two execution results. If the result is null, execute the fifth and sixth
commands. Null will be executed sequentially

npm config get proxy 
npm config get https-proxy
npm config set proxy null
npm config set https-proxy null
npm config set registry http://registry.cnpmjs.org/
npm install -g cnpm --registry=https://registry.npm.taobao.org

10. If it still doesn't work, execute

npm config set registry https://registry.npm.taobao.org

NVM1.1.7 version installation package (bai du wang pan)
link: https://pan.baidu.com/s/15pxIsvafmF5VhvFst8QDag
Extraction code: qdaq

Guess you like

Origin blog.csdn.net/m0_52313178/article/details/126282025