In a previous post, I’ve talked about Homebrew (and why it’s part of my setup).
I’ve also talked about Node, Gulp, and a few starter packages that I recommend for getting started with using them in WordPress development.
But one of the things I’ve not talked about is how to install Node using Homebrew.
Using Homebrew to Install Node
There are some ways to install packages on a Mac. Depending on the application, you can use the Mac App Store; you can use Composer, you can download something directly from a repository like GitHub, and so on.
But using a package manager comes with several benefits:
- it finds, downloads, and installs the package for you,
- it makes updating the software very easy,
- it makes uninstalling packages easy, too.
If you’re into a little bit of self-inflicted pain, then you can forgo any of the above. ☺️
But if you’re looking to save a little bit of time so you can focus on work, then I highly recommend Homebrew (or another package manager depending on the type of work you’re doing).
Installing Node with Homebrew
With all of the above said, this is why I’m a fan of using Homebrew to install Node and then, in turn, using Node to install packages such as Gulp.
First, make sure everything is good to go on your system, run the following commands:
You may need to run any commands that doctor provides; otherwise, simply run update, and you’re good to go.
To install Node using Homebrew, open your terminal and enter the following command:
After that, installing Gulp is easy.
Installing Gulp with Node
While still in your terminal, use the following command:
This is often the easiest step, but it can be confusing especially if you’re new to package management.
Essentially, you’ve used one package manager, Homebrew, to install another package manager, Node. The easiest way to think about it is to think of Homebrew as responsible for installing executable binaries and Node as installing JavaScript executables (or related libraries).
But, with that, this is yet another way to continue making sure your setup is as reliable as it can be while still being able to focus on work.