Installing & Running ReactJs from Scratch for Beginner's

Reading Time:- 1 min 55 sec

Reading Time:- 1 min 05 sec


Avatar

 BY TEJAS





For, installing ReactJs in our machine we have to first install NodeJs in our machine. For installing NodeJs please refer to this article.
→ A 3 step guide to download and install Node.Js

After installing the NodeJs in your machine open any terminal like cmd or any other terminal which you are using in your machine. When we newly install NodeJs, npm also comes with that. npm is a node package manager which helps us to download & install packages on our machine.



ADVERTISEMENT




After opening any terminal we have to run the below command


                            
npm install -g create-react-app

This command will install the create-react-app package in your machine. The create-react-app package helps us to create the ReactJs app.

Downloaded create-react-app package

Downloaded create-react-app package



                                
create-react-app <app name>

eg. create-react-app react-tutorial

This command creates a new react app with a provided name with that this command also downloads & install react, react-dom, and all necessary packages which are used to run a react app. when we create a first react app it takes a little bit of time.

File Structure

File Structure


The above image is the file structure of our project which is the default that comes with React.



ADVERTISEMENT




After installing and creating a new react app type the below commands to start the react server.


                                
cd <app name>
npm start

After, executing the npm start command your react app runs on port no :3000
copy http://localhost:3000 in your browser and see your react app is working.

React App Started

React App Started



ADVERTISEMENT




Congratulations, now you can able to start a new react app and run it into your browser.

If you find any difficulty plz comment down below.
thank you


COMMENTS





Search
Advertisement
Advertisement
Share With
Follow us on
Advertisement
Advertisement