Configuring ReactJS On MacOS
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]
- Install XCode from the Apple App Store.
- Install
homebrew:ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Use homebrew to install node:
brew install node
- Confirm that node is installed:
node -v
- 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]
- ↑ Create React App, React Docs
- ↑ How to Install Node.js and NPM on a Mac, Treehouse