Home > Web Front-end > JS Tutorial > Introduction to two methods of upgrading nodejs

Introduction to two methods of upgrading nodejs

青灯夜游
Release: 2020-12-23 18:26:19
forward
2908 people have browsed it

nodejsHow to upgrade? The following article will introduce you to two methods of nodejs upgrade. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

Introduction to two methods of upgrading nodejs

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)
Copy after login

Delete the specified version

$ n rm 7.10.0
Copy after login

Execute the script with the specified version

$ n use 7.10.0 some.js
Copy after login

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
Copy after login

Note: nvm has pitfalls when using it. It is recommended to use n to upgrade nodejs and control version.

For more programming-related knowledge, please visit:Introduction to Programming! !

The above is the detailed content of Introduction to two methods of upgrading nodejs. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template