How to upgrade nodejs: 1. Use the n module and use the "n stable" command to upgrade to the latest stable version, and the "n latest" command to upgrade to the latest version; 2. Use the NVM tool and use "nvm install lastest" to upgrade to the latest version.
The operating environment of this tutorial: centos7 system, nodejs version 14.15.4, DELL G3 computer.
The more powerful thing is: use Node Binary management module "n", you can use a very simple method to manage your Node versions.
# 全局安装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
Download nvm from github
Configure the project into the environment variable
$ source ~/.bashrc $ nvm --version
Upgrade version
# 升级到到定制版 $ nvm install 7.10.0 # 升级到最新版 $ nvm install lastest # 升级到稳定版 $ nvm install stable
[Recommended learning: "nodejs tutorial"]
The above is the detailed content of How to upgrade nodejs. For more information, please follow other related articles on the PHP Chinese website!