Sometimes, some projects use the old node, and some old ones cannot use the new node, but the new node is not compatible with the old version, so nvm (node version controller is produced)
1. Preparation
Delete the original node first
2. Download
https://github.com/coreybutler/nvm-windows/releases
3. Installation
During the installation, I encountered a lot of pits that caused node and npm to fail to install, and then I concluded that everything is installed to the c drive by default. . . Don’t change the location, I changed the location wrong, I can’t solve it
4. Modify nvm/setting.txt
This is for things that can be downloaded quickly in China, add 2 lines
node_mirror: https://npm.taobao.org/mirrors/node/
npm_mirror: https://npm.taobao.org/mirrors/npm/
5. Commonly used commands
Check which nodes are installed
//查看
nvm list
See which versions are available for download
nvm list available
Download a version
In fact, the above is just a list of some versions, go to the official website to check the version number, and think about the next one.
nvm install 版本号
如nvm install 8.9.4
Switch to a version
nvm use 版本号