Home  >  Article  >  Web Front-end  >  Update node.js to the latest version under mac

Update node.js to the latest version under mac

青灯夜游
青灯夜游forward
2021-01-08 18:44:574811browse

How to upgrade

nodejs to the latest version under mac? The following article will introduce the method to you. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

Update node.js to the latest version under mac

Related recommendations: "nodejs video tutorial"

Upgrade node.js under mac

The first step, check the current version

node -v

The second step, clear the cache of node.js:

sudo npm cache clean -f

The third step, install the node.js version Management tool, n, his name is n

sudo npm install -g n

The fourth step is to install the latest stable version

sudo n stable

The fifth step is to check the updated version

node -v

Step 6: Update the npm version

sudo npm install npm@latest -g

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

The above is the detailed content of Update node.js to the latest version under mac. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete