Configuring ReactJS On MacOS

From Littledamien Wiki
Jump to navigation Jump to search

Prerequisites[edit]

The React docs recommend using npm to create a new React app. [1]

npm requires Node >= 6.

To install npm and node: [2]

  1. Install XCode from the Apple App Store.
  2. Install homebrew:
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  3. Use homebrew to install node:
    brew install node
  4. Confirm that node is installed:
    node -v
  5. Confirm that npm is installed:
    npm -v

Creating a new React app[edit]

Use npm to install the utility that creates new React app boilerplate (this only needs to be done once):

$ npm install -g create-react-app

Use create-react-app to create a new app:

$ create-react-app my-app

Start the app:

$ cd my-app
$ npm start

After running the app with npm start the app will be available at http://localhost:3000

IDE[edit]

WebStorm by JetBrains (I have a license)

Notes[edit]