0. nvm builds the relationship diagram of reactNavite:
The advantage of nvm is multi-version control node
1. First uninstall clean node
2. Remember to run cmd.exe and vscode as an administrator
- Find the path from cmd.exe
: C:\Windows\System32
Right click to run as administrator - Find vscode
right click to run as administrator
3. Install nvm
-
Find the official website of nvm, https://github.com/coreybutler/nvm-windows/releases
-
Download the installation package nvm-setup.zip , and follow the prompts to complete the installation.
-
Go to cmd.exe under
C:\Windows\System32 and right-click to run it as an administrator. -
Command:
nvm
, to check whether nvm is installed successfully. -
Success is as follows:
4. The configuration of environment variables is critical:
- Add the following two sentences to settings.txt under C:\Users\admin\AppData\Roaming\nvm and save it.
node_mirror:https://npm.taobao.org/mirrors/node/
npm_mirror:https://npm.taobao.org/mirrors/npm/
- Find the advanced system settings --> environment variables --> Path --> edit --> new --> add the following two sentences --> OK.
Show partial list of downloadable versions
nvm list available
Check the installed nvm version
nvm list
5. Install node
Install the specified version of nodejs
nvm install 16.12.0
Use the specified version of nodejs
nvm use 16.12.0
Check the installed version of nodejs
node -v
6. Install yarn
install yarn
npm install -g yarn
Check the version number:
yarn -v
7. Install npm
Just install node.js: nodejs download address
Check the version installed by npm:
npm -v
8. Install cnpm
install cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
Check the version number:
cnpm -v