How to install React?
Tags: react, javascript, beginners, tutorial
Published: 2022-08-04 04:42:29

ReactJs is one of the most widely used Javascript front-end libraries created by Facebook. It is used for mobile and web application development. React contains a collection of reusable code snippets used for building UI, called components.

ReactJS also allows you to create your own components and use them to create complex UIs.

                        ## Table of Contents

1. **How to install Node js in windows**
2. **Verify the installation**
3. **Create React Project**
4. **Run React App**
5. **Conclusion**

## 1. How to install node js in windows

The first step you need to do, before you start coding in ReactJS, is to install Node JS. Node.js is a JavaScript runtime built on Chrome’s V8 JavaScript engine.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0ia9ru28e89cjrddkvrm.PNG)
Node JS for windows


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x5sqjbujy1oiompkm3at.PNG)
Click on Run


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/to6xukcwvr2dlkgjb4lp.PNG)
Click Next


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s641l63ebh3wlouqbkkm.PNG)
Accept the terms and click on Next


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eg9t6qrb6etblrqk3mla.PNG)
Select your directory and click on Next


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5e8i1btbvwbbq470yje5.PNG)
Click Next


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/acmi4m0i69f68kwzn2as.PNG)
Skip this process – Click Next


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fhf674f809e6a6th46ia.PNG)
Click Install and it will install NodeJS to your machine


## 2. Verify the installation

Now that we have installed NodeJS. Let’s make sure that it is installed correctly with npm ( node package manager).

Run the following command in the cmd to check the node version.

```
C:\Users\Username> node -v
```
If it displays some version number, then it means we have successfully installed nodeJS to our machine.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nxrhijk4wvioyzlidtcn.PNG)
check node version

```
C:\Users\Username> npm -v  
```
It will display some version number if everything installs correctly.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2hqw1w4749fb7dty8pif.PNG)
check NPM version

## 3. Create React Project

Now that everything is working correctly, we will move on to creating our very own ReactJS project. To do so, you will need to go the directory, where you want to have your project. And run the following command:

```
C:\Users\Username> npx create-react-app myfirstreactapp
```

`Note: Your react project name should be lowercase. `


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wcv9e1mvnb5t3vtdja2h.PNG)
Creating a new React project

The above command will take sometime to create a new project with the name “myfirstreactapp.” Now, we can see the terminal as like below.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/39m9agz3n0zb13gdriri.PNG)
React Project installed correctly

## 4. Run React App

The above screen confirms successful creation of our project. Now, we need to start the server so that we can access the application on the browser.

Type the following command in the cmd:

```
// This is go into our react project. 
cd myfirstreactapp 


npm start
```
Doing so, will start our ReactJS project, which we can access on our local browser.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1fi6czcz9s4neg8l7klw.PNG)
React project running successfully


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b374rzev1qikmwe6yyms.PNG)
React project running in our local browser

We have successfully ran our own ReactJs project.


## 5. Conclusion

I hope that was easy for everyone to follow. As we have seen above, it’s really easy to install and run ReactJs on our system using NodeJS. Using create-react-app allows us to create ReactJs project immediately and we can start coding right away. 

For more articles, visit: 

[Tech With Sherry](https://techwithsherry.com/)

Related Article: 

[Beginners guide to React and Bootstrap](https://techwithsherry.com/bootstrap-with-react/) - Create Responsive Layout in React