Change method: 1. Use the nvm tool and execute the "nvm install specified version number" command to switch to the specified version, and the "nvm install lastest" command to upgrade to the latest version; 2. Use the Node Binary management module, Execute the "n specify version number" command to switch to the specified version.
The operating environment of this tutorial: linux5.9.8 system, nodejs version 12.19.0, DELL G3 computer.
Sometimes we need to be forced to upgrade or downgrade the nodejs version. At this time, the problem arises. How to do it. The summary is as follows. There are two types found in total. The following is the change of the nodejs version in these two cases. Let me talk about it, nvm and n are both nodejs version management libraries, and you can use them all depending on your personal habits.
Method 1, use nvm tool
1), switch to the specified version
nvm install 指定版本号
2), upgrade to the latest version
nvm install lastest
3), upgrade to the stable version
nvm install stable
Method 2: Use n tool
Node Binary management module "n" can be used A very simple way to manage your Node version
1), modify the version
n 指定版本号
2), upgrade to the latest stable version
n stable
3), Upgrade to the latest version
n latest
For more node-related knowledge, please visit: nodejs tutorial! !
The above is the detailed content of How to change nodejs version. For more information, please follow other related articles on the PHP Chinese website!