An end to the never ending story of ReactJS development environment setup

Written by James McDonald

December 3, 2016

screen-shot-2016-12-03-at-11-38-21-pm

So I just learn’t that there is a command that can create a react environment quickly and easily. And it includes the cool web server that reloads every time you edit your component code and also it has a build command to compile it to production….  A lot easier than following a multi-stage tutorial on how to install all the components individually. Just two commands and you are away. Firstly you need node installed and then you do the following two commands.

[email protected] tmp $ npm install -g create-react-app

[email protected] tmp $ create-react-app jmits
Creating a new React app in /Users/jmcd/tmp/jmits.

Installing packages. This might take a couple minutes.
Installing react-scripts from npm...

Success! Created jmits at /Users/jmcd/tmp/jmits
Inside that directory, you can run several commands:

  npm start
    Starts the development server.

  npm run build
    Bundles the app into static files for production.

  npm test
    Starts the test runner.

  npm run eject
    Removes this tool and copies build dependencies, configuration files
    and scripts into the app directory. If you do this, you can’t go back!

We suggest that you begin by typing:

  cd jmits
  npm start

Happy hacking!
[email protected] tmp $ cd jmits
[email protected] tmp $ npm start

Starting the development server...

Compiled successfully!

The app is running at:

  http://localhost:3000/

Note that the development build is not optimized.
To create a production build, use npm run build.

 

0 Comments

Submit a Comment

Your email address will not be published.

You May Also Like…

ZPL SBPL

Zebra Printer Language http://labelary.com/viewer.html The above website has a page where you can enter ZPL and it...