If you installed Homebrew in the previous step, use it to install Node.js:
brew install node
If not, you can click one of the big, green download links on the Node.js web site.
Node version numbers are confusing, but either the LTS version (8.11.1 as of this writing) or the Current version (10.0.0) will do for our purposes.
After Node is installed, test your installation by running NPM, a JavaScript package manager that’s included with Node. Run the following command:
npm install -g create-react-app
You should see a progress bar of sorts while packages download and, eventually, a tree structure of various package names and version numbers. As you may have guessed, aside from testing your Node installation, this has the side effect of installing create-react-app
, which we’ll later use to do exactly what its name suggests.
If the npm
command isn’t available, open a new tab in your terminal and try again. Opening a new tab should make node
and other related commands available to you from any directory, if they weren’t already.
Yarn is an alternative to NPM that offers several advantages—not the least of which is speed.
If you’ve installed Homebrew, run the following command to install Yarn:
brew install yarn
Otherwise, follow the insructions on the Yarn site to Install Yarn.
Once Yarn is installed, run this command to test it:
yarn global add eslint