The easiest way to update your Node.js on your Mac

Node.js Beginner Guide

Joe T. Santhanavanich
Mac O’Clock

--

illustration by Chaeyun Kim

Several new JavaScript libraries in the NPM require the latest Node.js version, so you should keep updating your Node.js. Let’s see the easiest way how to do it!

1. Open your console and check your Node.js version.

$ node -v
v x.x.x

2. Install n package using npm if you do not have it installed yet.

$ sudo npm install -g n

3. Then, you can update your Node.js to the version you want.

(Use this command to install the stable node release.)
$ sudo n stable
(Use this command to install/update the latest node release.)
$ sudo n latest
(Use this command to install/update the latest LTS node release.)
$ sudo n lts

4. That’s it! You can verify that the update is successful by checking your Node.js version again.

$ node -v
v x.x.x

I hope you enjoyed it and found it useful for your daily work or projects. Please, feel free to contact me if you have any questions.

About me & See all my blog contents: Link

Be Safe and Healthy!
Thank you for Reading. 👋😄

--

--