![]() |
VOOZH | about |
React is a powerful JavaScript library for building fast, scalable front-end applications. Created by Facebook, it's known for its component-based structure, single-page applications (SPAs), and virtual DOM, enabling efficient UI updates and a seamless user experience.
Follow these Steps to Install React.js and Create a React App on Windows 10/11:
React relies on Node.js and its package manager, npm, to manage dependencies. To install React, start by installing Node.js, which includes npm (Node Package Manager).
Note: Node.js is a free, open-source, and cross-platform runtime environment for JavaScript. It enables developers to build servers, web applications, command-line tools, and scripts, all using JavaScript outside of a browser.
Open Command Prompt or PowerShell > Check the installed versions by running these commands:
Vite is a modern build tool that offers lightning-fast startup and optimized development experience for React and other frameworks.
1. Create React App with Vite
Run the following command:
npm create vite@latest my-react-app -- --template reactYou can replace my-react-app with your preferred app name (use lowercase).
2. Install Dependencies
Navigate into your project directory and install required packages:
cd my-react-app
npm install
3. Start the Development Server
Run the development server:
npm run devOpen your browser and go to http://localhost:5173 to view your new React app.
Run the following command to create a React app:
npx create-react-app reactfirstNote:
- The app name must be in lowercase due to npm naming restrictions.
- This command installs all required dependencies and sets up your app.
It will take some time to install the required dependencies
Note: Due to npm naming restrictions, names can no longer contain capital letters, thus type your App name in lowercase.
Note: For modern projects, prefer Vite or Next.js for improved performance and ecosystem support.
Create a new folder where you want your React app, use the following command:
mkdir newfolderNote: The newfolder in the above command is the name of the folder and can be anything.
Move inside the same folder using the below command:
cd newfolder (your folder name)Now open the IDE of your choice for eg. Visual studio code and open the folder where you have installed the react app newfolder (in the above example) inside the folder you will see your app's name reactapp (In our example). Use the terminal and move inside your app name folder.
Use the following command:
cd reactapp (your app name)Start the development server by running:
npm run dev or if you are using CRA then run the folloiwng command
npm startOnce you run the above command, a new browser tab will open, displaying the default React page with the React logo.
Congratulation! You have successfully installed the react-app and are ready to build awesome websites and app. Whether you used CRA, Vite, or another tool, youβre now ready to start building dynamic web applications. Explore Reactβs features like components, state, and props to create amazing projects.
Boost Your React Development Skills with the React JS Course
Take your React development expertise to the next level by enrolling in the React JS Course offered by GeeksforGeeks. This complete course offers installation process, covering essential topics like components, state management, and routing. With hands-on projects and real-world applications, youβll gain practical experience to confidently build dynamic, high-performance web applications. Equip yourself with the skills needed to excel in modern web development.