React

Ever wondered how to get started with some basic Javascript? Here’s a quick and dirty run through of the terminal commands to get your first web app up and running. Remember, Node.js and npm was already be installed on your computer before starting. If not, enter this into terminal to get Homebrew (brew.sh) and once that’s complete, enter the following string.

> /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

> brew install npm

Install React app builder using node package manager.

> npm install create-react-app -g

Create a react app project, aptly named “my-app.”

> create-react-app my-app

terminal_react_myapp

Change directory into newly created app folder.

> cd my-app

Start the npm server for the app.

> npm start

terminal_npm_start

To create a production version of the web app:

> npm run build

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s