Tutorial on using node version management tool n

1. Installation 

n is a nodejs management tool, https://github.com/tj/n

 npm install -g n

2. Use n to install the nodejs version

// 安装最新版本
n latest

// 安装指定版本13.11.0
n node/13.11.0

3. Switch nodejs version

// 终端输入n
n

Use the up and down arrow keys to select the installed version and press Enter to confirm.

 After the switch is successful, use the node -v command to view the current version. If the version number just selected is displayed, the switch is successful.

Note: After switching, if the version is still the original v6.x version, you may need to use administrator rights (sudo n).

If it still doesn't work, you may need to set the PATH.


 

Guess you like

Origin blog.csdn.net/weixin_38649188/article/details/129796452