Home > Article > Web Front-end > Update node.js to the latest version under mac
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.
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!