How to Update Node.js to Latest Version on Mac

How to Update Node.js to Latest Version on Mac.

You can update node.js to the latest version on a Mac by using the command line Homebrew toolYou can update node.js to the latest version on a Mac by using the command line Homebrew tool

If you employ Node.js for net improvement, creation of net apps, and javascript primarily based network functions, you undoubtedly could come throughout conditions the place you’d prefer to guarantee that the newest model of Node.js is put in in your Mac. Upgrading to the newest model of Node.js means you’ll have entry to the newest options and safety updates accessible.

Assuming you will have put in Node.js and npm with Homebrew (which suggests you will have additionally already put in Homebrew on the Mac too), which is arguably the simplest option to set up node.js onto a Mac and to handle the javascript runtime atmosphere, then you will see that updating Node.js to the newest model is actually fairly easy when you learn the way.

How to Upgrade Node.js to the Latest Version on Mac with Homebrew

One of the various advantages of using Homebrew to handle command line software program is that it’s not solely simple to put in packages, but additionally to update them, handle them, and even uninstall them from the Mac. For our functions right here, we’re going to display how to guarantee that Node.js is up to date to the newest model by utilizing Homebrew. To get began, open the Terminal or your command line app of selection.

Optional, however not vital, is to first verify which model of node.js and npm you will have put in on the Mac, which is feasible with the next command:

node -v && npm -v

Now, you’ll want to update Homebrew, in order that Homebrew itself can retrieve the newest variations of software program:
brew update

After brew update has ran, you’ll want to run the brew improve command next. You can use brew improve for all packages put in with Homebrew, which is advisable, or you’ll be able to specify solely upgrading node.js, whichever you favor:

Install updates to all Homebrew packages:
brew improve

OPTIONALLY, solely set up and improve to the newest Node.js model by way of Homebrew:
brew improve node

After the improve command has executed, you’ll now need to run the npm update command, with the set up and -g flag to put in the updates globally to the npm command itself, which appears like this:

npm set up -g npm

After that has accomplished, you’ll be able to verify that node.js and npm have been upgraded to the newest variations by operating the next command string once more:

node -v && npm -v

And there you will have it, you will have now put in the newest accessible variations of Node.js and npm on the Mac, and verified that the newest model is put in, all with the benefit of the Homebrew bundle supervisor.

Technically you may as well set up and improve node.js manually with a bundle installer too, however with how handy Homebrew is to handle command line utilities and apps on the Mac, it truly is the best option to go.


Check out more article on – How-To tutorial and latest highlights on – Technical News, Apple Products
Exit mobile version