How to upgrade nodejs version? The following article will share with you two ways to upgrade the nodejs version. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.
Related recommendations: "nodejs Tutorial"
Method 1: Use n to upgrade nodejs
# 全局安装n $ npm install -g n # 升级到最新稳定版 $ n stable # 升级到最新版 $ n latest # 升级到定制版 $ n v7.10.0 # 切换使用版本 $ n 7.10.0 (ENTER)
Delete the specified version
$ n rm 7.10.0
Execute the script with the specified version
$ n use 7.10.0 some.js
Method 2: Use NVM to upgrade nodejs
github Download nvm
Configure the project into the environment variable
$ source ~/.bashrc $ nvm --version # 升级到到定制版 $ nvm install 7.10.0 # 升级到最新版 $ nvm install lastest # 升级到稳定版 $ nvm install stable
For more programming-related knowledge, please visit: Programming Video! !
The above is the detailed content of How to upgrade nodejs version? Two upgrade methods to share. For more information, please follow other related articles on the PHP Chinese website!