installed. If you have an older version of NPM, run this command to update it:
npm install -g npm
What is create-react-app?
Since it is complicated and takes a lot of time, we don't want to configure React manually. create-react-app is a much easier way which does all the configuration and necessary package installations for us automatically and starts a new React app locally, ready for development.
Another advantage of using create-react-app is that you don't have to deal with Babel or Webpack configurations. All of the necessary configurations will be made by create-react-app for you.
In order to install your app, first go to your workspace (desktop or a folder) and run the following command:
npx create-react-app my-app
The installation process may take a few minutes. After it is done, you should see a folder that appears in your workspace with the name you gave to your app.
Note: If you're on Mac and receiving permission errors, don't forget to be a super user first with the sudo command.
How to Run the App You Created with Create-React-App
After the installation is completed, change to the directory where your app was installed:
cd my-app
and finally run npm start to see your app live on localhost: