If you are looking to run JavaScript outside your browser, setting up Node.js on macOS is your very first step. I remember trying to code my first local server years ago and getting completely stuck because my environment was a mess and I lacked the right tools. It can feel a bit intimidating if you are new to terminal commands, but getting this software running on an Apple machine is incredibly straightforward. In this post, I will walk you through exactly how to get Node.js on your Mac in just a few minutes without running into any technical headaches.
How to download Node.js installer?
First, open Safari or whatever browser you prefer. Type nodejs.org into your address bar and hit enter to reach the official website. I once accidentally downloaded a package from a third-party mirror site and had to wipe my drive just to be safe, so always stick to the official source.
What are download steps?
- Click the Get Node.js button on the site.
- Look towards the bottom of the page for the macOS Installer option. If you use a device with an Apple chip, this option pops up automatically.
- At the top of the page, there are pre-built Node.js versions for Mac OS, Windows, and Linux. Select whichever operating system you currently use.
- Next, select your architecture. I chose 64-bit since that is what my machine runs.
- Click the macOS Installer and allow the download if your browser asks.
After these actions, your package starts downloading. It usually takes about 15 seconds on a decent connection.
How to set up Node.js?
Once the download finishes, open the file. You are only a few clicks away from finishing the setup:
- Click the Continue button on the interface that opens.
- Select Agree to accept the license terms.
- Hit the Install button.
- Type your Mac system password and press the Install Software button.
At this stage, all packages start loading. Once the packages finish unpacking and you complete the last few prompts, Node.js is successfully on your system.
How to check if setup is successful?
To verify everything works flawlessly and you didn’t hit a silent error during the process, open your system’s Terminal and run these commands in order:
node --versionnpm --version
Both commands must return a version number. If you see these two versions pop up in your Terminal, your Node.js environment is perfectly configured and ready to go.
