1. Install Create-react-app With Npm
  2. How To Install Npm
React JS Environment Setup using NPM or Yarn: Setting up the ReactJS development environment using NPM or Yarn. Here, we will learn how to set up a development environment in ReactJS and the following things.

Tried npm uninstall -g create-react-app that didn't work for me. I did the following and it worked: Elevated cmd prompt: where create-react-app it was somewhere in the system files under yarn. Follow that path and delete both the files. Go to the working directory, in my case a folder inside documents. Run npx create-react-app my-test-app.

  • Creating React App.
  • Building Project.
  1. #Install the create react app command npm install -g create-react-app #Create a react-electron1 project create-react-app react-electron1 #Launch project cd react-electron1 && yarn start Electron addition and configuration. Stayreact-electron1Project additionselectronpackage. Yarn add electron. Configure main.js.
  2. Create react app for mac install globally; react project and yarn; install react for react; create existing application to a react app; how to run existing react app; how to create react app step by step; react app from cmd; creat a react app; create a react project cmd; running yarn react app on localhost; create react app windows; npm install.

Contents

  • 1 Steps to install React JS using NPM

Steps to install React JS using NPM

1. React provided us a CLI command called create-react-app, we need it to install it globally

2. After create-react-app installs successfully go ahead and create a new project

Using comment create-react-app my-app, this command will create a new directory and install our react app. This command gives a directory listing

my-app
  • README.md
  • node_modules
  • package.json
  • .gitignore
  • public- favicon.ico,Index.html,manifest.json
Npm Install Create-react-app Yarn Mac

src

  • App.css
  • App.js
  • L App.test.js
  • UI index.css
  • index.js
  • Logo.svg
  • registerServiceWorker.js

Folder Structure Explanation

Install Create-react-app With Npm

  • Package.json-This file contains info about installed modules
  • src/-This folder contains source code.
  • public/-This folder contains asset files for your app.
  • node_modules- This folder contains all the installed modules package.
  • gitignore- This file contains ignored files and folders for GitHub push and pull.
3.After installation gets completed. Go to the installed directory and run your app

4. You can use Yarn or NPM to run ReactJS app

This command will initialize our app and if our application compiles successfully we will be greeted with React welcome screen:

5. We have set up an environment set up in our application. Now let’s create our app build. We will need below command to build our app

6. This will build your app in the build folder. We will need to install serve globally to serve our build app. You can install serve globally by:

7. This will install serve globally and we can serve our application by:

8. This will run our build application on the server:

How To Install Npm

The same app will be run a different server. But the application is ready to deploy!

Now we have learned how to install React JS using NPM or Yarn. Let’s do some exercise on React JS

How to install this project with Yarn?

In case you didn’t know how to install an application with Yarn. Go ahead to https://yarnpkg.com/,.and you can install yarn from here, you have followed the conditions to install React JS using yarn.

This will install create-react-app and let us initialize our React Application with the above following steps.