Configuring ReactJS On MacOS: Difference between revisions
Jump to navigation
Jump to search
(Created page with "== Prerequisites == The React docs recommend using `npm` to create a new React app. <ref>[https://reactjs.org/docs/add-react-to-a-new-app.html Create React App], React Docs</...") |
|||
| Line 33: | Line 33: | ||
$ npm start | $ npm start | ||
</syntaxhighlight> | </syntaxhighlight> | ||
After running the app with `npm start` the app will be available at http://localhost:3000 | |||
== IDE == | == IDE == | ||
Revision as of 17:55, 1 March 2018
Prerequisites
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
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
WebStorm by JetBrains (I have a license)
Notes
- ↑ Create React App, React Docs
- ↑ How to Install Node.js and NPM on a Mac, Treehouse