node.js version management

Here is the multi-version manager n of node.js to upgrade and switch, the command is as follows:

1. sudo npm cache clean -f //clear node.js cache

2. sudo npm install -gn //Use npm to install n modules

3. npm view node versions // View all versions of node

4. sudo n latest // Upgrade to the latest version

      sudo n stable // Upgrade to a stable version

      sudo n xx.xx // Upgrade to a specific version number

5. node -v //View the currently installed version number

6. n //Check which versions of node are currently installed, the installed node version will appear, select one and you can switch directly

Guess you like

Origin blog.csdn.net/weixin_39089928/article/details/132338837