How to Install ReactJS on MacOS?

  1. ReactJS library installation.
  2. Creating a ReactJS project.

NodeJS and NPM:

In order to install ReactJS on MacOS, you must first have NodeJS and NPM installed. NodeJS is a JavaScript runtime which makes it possible to run JavaScript outside of the browser. NPM(node package manager) is used to install libraries such as ReactJS on the command line.

Installing Nodejs & NPM:

The only way you can install NodeJS is through their official website. Installing NodeJS will also automatically download NPM on your machine. You can find their NodeJS downloads section here.

export PATH=/usr/local/bin:$PATH
node --version
npm --version

Installing ReactJS on MacOS:

Now that you have NodeJS and NPM installed, You should now be able to install ReactJS in your project’s directory by running:

npm install --save react react-dom

Creating a ReactJS project:

Now that you have ReactJS installed, you can create a new react project directory by running:

npx create-react-app my-react-project
cd my-react-project
npm start

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store