React can be used as a base for the development of single-page or mobile applications. It is a powerful library to deal with complex projects in an easy manner.
React Native, one of the most lovable hybrid mobile application development frameworks is also based on React.
Here I am going to explain the installation and set up of a React App on Windows 10 platform. As React is a library, we can start using it inside our project just by importing it.
But here we are going to install the
create-react-app tool(a tool built for us to create react applications) and build a react app using it on Windows 10 Operating System.
For visual learners, the video below will help you to do this installation faster. It is completely based on this blog post.
For others, please follow the below steps to install React on Windows 10.
1. Install Nodejs
In this tutorial, we are going to install create-react-app tool using the Node Package Manager(NPM). Create-react-app is a tool developed by React.js team that makes the setting up of React in our system easier.
So first, it needs to install Nodejs on our system. NPM will be installed with Nodejs. The current stable version of Node.js can be downloaded and installed from the official website that is given below.
Download the latest version and install it. You can choose LTS or latest version.
After the installation, check the versions using the below commands.
node -v npm -v
This will show the installed versions of Node.js and NPM.
Note:- If you are really a beginner in this field, the guide Steps to install Node.js and NPM on Windows 10 will help you.
2. Install Create-React-App Tool
Now we need to install a tool named create-react-app using NPM as global. This tool is used to create react applications easily from our system.
npm install -g create-react-app
3. Creating a New React Project
After the successful installation of create-react-app, we can create our first react application using it.
Here awesome-project is the name I have chosen for my react project.
We can combine the steps 2 and 3 with a single command using NPX(package runner tool that comes with NPM 5.2+).
npx create-react-app awesome-project
Here NPX will temporarily install create-react-app and create a new react project named awesome-project.
4. Running the Application
The app we created can run locally on our system with npm start command.
cd awesome-project npm start
This will opens up the react application in a new tab of our browser with the below URL.
Note:- If port 3000 is busy with another process, the app will start in port 3001 or any other port available.
So, in this article, we have discussed the steps for the installation of React.js on a Windows 10 system. These steps are verified by our team and 100% working.