Unable to switch version successfully after installing multiple versions of node

1. Uninstall the previously installed node version; and find two files C:\Users\lenovo\AppData\Roaming\npm and C:\Users\lenovo\AppData\Roaming\npm-cache

2. Download nvm https://github.com/coreybutler/nvm-windows/releases // Download nvm-setup.zip and follow the steps to install;

3. After installation, use the command nvm -v if no error is reported, the installation is successful;

4. nvm install 10.15.3 uses the nvm install version number to install the node of the object, and will download the version of npm according to the version of node, so you don’t need to download npm separately; (download is slower, you need to wait long long time), Install other needs to continue to install nvm install 10.13.3

5. After the installation is successful, use nvm use 10.15.3

Now using node v10.15.3 (64-bit)

The above code appears to indicate that the specified version number is switched

6, nvm ls view

*10.15.3 The asterisk represents the current node version

10.8.0

7. Execute node -v npm -v again to view the current version number

Note: If the switch command is successful, but the actual version fails to switch to the current version, and node command not found appears; you need to check whether it exists, that is, you have installed node before, find this file C:\Program Files\nodejs, if it exists, you need to Rename the previous nodejs to another name such as nodejsx, and then re-execute the switch command; (the official website has instructions here)

Guess you like

Origin blog.csdn.net/qq_40010841/article/details/109580968