Install React on MacOS
The following is a step by step process to install ReactJS on you macOS.
Step 1: Install Homebrew
Homebrew is a popular package manager for macOS that simplifies the installation of software.
- Open the Terminal app.
- Enter the following command to install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- After installation, verify Homebrew by running:
brew --version

Step 2: Install Node.js and npm
React requires Node.js and npm (Node Package Manager) to run.
- Use Homebrew to install Node.js:
brew install node
- Verify the installation:
node --version
npm --version
Step 3: Install a Code Editor (Optional)
While any code editor can be used, Visual Studio Code is highly recommended for React development.
Step 4: Create a New React Application
React applications are typically created using Create React App, a CLI tool for React setup.
- Open the Terminal.
- Navigate to the directory where you want to create your project:
cd /path/to/your/directory
Let us say that we would like to create our project in /Users/tutorialkart/workspace/react_tutorial
directory. We have created the missing directories and navigated to the same, as shown in the following screenshot.

- Run the following command to create a new React app:
npx create-react-app my-app
If you get any error like “Found: react@19.0.0. Could not resolve dependency: peer react@”^18.0.0″ from @testing-library/react@13.4.0”, it means that there is a version mismatch between the installed version of React (react@19.0.0
) and the peer dependency required by @testing-library/react
(react@"^18.0.0"
).
- Replace
my-app
with your desired project name. Thenpx
command ensures you’re using the latest version of Create React App without installing it globally. - Navigate into the project directory:
cd my-app
- Start the development server:
npm start
- Your default browser should open, displaying the React starter page at
http://localhost:3000
.
Step 5: Customize Your Environment (Optional)
Install React Developer Tools
- Install the React Developer Tools extension for your browser:
- For Chrome: React Developer Tools
- For Firefox: React Developer Tools
- This tool helps you inspect and debug React components.
Step 6: Explore Your React Application
- The
src
folder contains the main files for your application. - Modify
src/App.js
to make changes to the app. - Use
npm run build
to create a production-ready build of your app.
Next Step: Begin your React journey by learning about components, props, and state!