React Installation Tutorial for Beginners Node.js (2026)
What Is React?
React is a free, open-source JavaScript library developed
by Meta (formerly Facebook). It is used to build fast, modern, and interactive
user interfaces for websites and web applications.
Unlike traditional websites where the entire page reloads
after every action, React updates only the parts of the page that change. This
makes applications feel faster and provides a better user experience.
Today, React is used by companies such as Meta, Netflix,
Airbnb, Shopify, Dropbox, and many other organisations to build
high-performance web applications.
Introduction
If you're planning to become a frontend developer, React
is one of the best technologies to learn. Before you can start building React
applications, you need to prepare your computer with a few essential tools.
These tools allow you to write code, install React, test your application, and
view changes instantly in your browser.
Don't worry if you've never worked with React before.
This guide is written in simple, beginner-friendly language. We'll go through
every step, explain why each tool is needed, and create your first React
application together.
By the end of this tutorial, you'll have a fully working
React development environment and understand the purpose of every file created
in your first project.
What Do You Need Before Installing React?
React doesn't work by itself. It needs a development
environment that helps compile your code, install packages, and run a local
development server.
Before creating your first React application, install
these tools:
- Node.js
– Runs JavaScript outside the browser.
- npm
(Node Package Manager) – Installs React and other libraries.
- Visual
Studio Code (VS Code) – A modern code editor for writing React
applications.
- Git
(Optional but recommended) – Helps you manage code versions and
upload projects to GitHub.
- Vite
– A modern build tool used to create React projects quickly.
Step 1: Install Node.js
What is Node.js?
Node.js is a JavaScript runtime that allows JavaScript
code to run on your computer instead of only inside a web browser.
When developing React applications, Node.js is
responsible for installing packages, starting the development server, and
running build tools behind the scenes.
Without Node.js, you won't be able to create or run a
React project.
Why Do We Need Node.js?
Node.js performs several important tasks:
- Runs
JavaScript outside the browser.
- Installs
React and third-party libraries.
- Includes
npm (Node Package Manager).
- Starts
the React development server.
- Helps
build and optimise applications for production.
Think of Node.js as the engine that powers your React
development environment.
How to Install Node.js
Installing Node.js is simple.
- Visit
the official Node.js website.
- Download
the LTS (Long-Term Support) version. This version is stable and
recommended for beginners.
- Run
the installer.
- Keep
the default installation settings.
- Click
Next until the installation finishes.
- Restart
your computer if required.
Once installed, Node.js and npm are ready to use.
Check Whether Node.js Is Installed
Open Command Prompt, PowerShell, or Terminal and type:
node -v
Example:
v22.10.0
If you see a version number, Node.js has been installed
successfully.
Check npm Version
Now type:
npm -v
Example:
10.9.0
This confirms npm was installed automatically with
Node.js.
Step 2: Install Visual Studio Code (VS Code)
What is VS Code?
Visual Studio Code is one of the world's most popular
code editors. It is lightweight, fast, free, and designed for modern web
development.
Most React developers use VS Code because it offers
excellent support for JavaScript, React, HTML, CSS, Git, and many other
technologies.
Whether you're creating a small practice project or a
large professional application, VS Code provides the tools needed to write
clean and organised code.
Why Use VS Code for React?
VS Code offers many helpful features:
- Easy-to-use
interface.
- Intelligent
code suggestions (IntelliSense).
- Syntax
highlighting.
- Built-in
terminal.
- Git
integration.
- Debugging
tools.
- Thousands
of useful extensions.
These features improve productivity and reduce coding
errors.
Installing VS Code
- Download
VS Code from the official website.
- Run
the installer.
- Accept
the default settings.
- Complete
the installation.
- Open
VS Code.
You are now ready to start writing React code.
Recommended VS Code Extensions
Although React works without extensions, these tools make
development much easier.
- ES7+
React Snippets
- Prettier
- ESLint
- Auto
Rename Tag
- Auto
Close Tag
- Material
Icon Theme
- GitLens
- Error
Lens
These extensions improve formatting, highlight mistakes,
and speed up coding.
Step 3: Install Git (Optional but Recommended)
What is Git?
Git is a version control system.
It records changes made to your project, allowing you to
go back to previous versions if something goes wrong.
Professional developers use Git every day because it
makes teamwork and project management much easier.
What is React
Why Learn Git?
Git allows you to:
- Save
your project history.
- Undo
mistakes.
- Work
with other developers.
- Upload
projects to GitHub.
- Build
a professional portfolio.
Even if you're learning alone, Git is a valuable skill
for future jobs.
Verify Git Installation
Open Terminal and type:
git --version
Example:
git version 2.49.0
Step 4: Create Your First React Project
Modern React applications are commonly created using
Vite.
What is Vite?
Vite is a modern development tool that creates React
projects quickly and starts the development server almost instantly.
Compared with older tools, Vite offers:
- Faster
startup.
- Faster
page refresh.
- Smaller
project setup.
- Better
development experience.
For these reasons, most new React tutorials now recommend
Vite.
Create the Project
Open Terminal and run:
npm create vite@latest
The installer will ask a few questions.
Example:
Project Name:
react-app
Framework:
React
Variant:
JavaScript
After the project is created, move into the project
folder.
cd react-app
Install all required packages.
npm install
This command downloads everything your project needs.
Step 5: Start the Development Server
Run the following command:
npm run dev
You'll see output similar to:
Local: http://localhost:5173/
Open the displayed address in your browser.
If everything is installed correctly, you'll see the
default React welcome page.
Congratulations! Your first React application is now
running successfully.
Understanding the React Project Structure
When you open the project in VS Code, you'll notice
several folders and files.
Each one has a specific purpose.
node_modules
This folder contains all installed packages and project
dependencies.
You should never edit files inside this folder manually
because npm manages it automatically.
public
The public folder stores static files such as:
- Images
- Icons
- Logos
- PDF
files
- Other
public assets
Files placed here can be accessed directly by the
browser.
src
The src folder is the heart of every React project.
This is where you'll spend most of your time.
It usually contains:
- Components
- CSS
files
- JavaScript
files
- Images
- Hooks
- Utilities
As your application grows, the src folder will contain
all of your application logic.
App.jsx
The App.jsx file is the main React component.
It controls the content displayed on the screen.
Example:
function App() {
return (
<h1>Welcome to React!</h1>
);
}
export default App;
Code Explanation
function App()
Creates a reusable React component.
return
Returns the user interface that should appear in the
browser.
<h1>
Displays a heading.
export default App
Makes this component available for use in other files.
main.jsx
This is the entry point of your React application.
Its job is to load the App component and display it
inside the browser.
You usually don't modify this file very often.
Create Your First React Program
Open App.jsx and replace its contents with:
function App() {
return (
<div>
<h1>Hello, React!</h1>
<p>Welcome to my first React application.</p>
</div>
);
}
export default App;
Save the file.
Your browser will automatically refresh.
You'll now see:
Hello, React!
Welcome to my first React application.
This is your first working React program.
Common Installation Problems
Error: 'node' is not recognised
Reason
Node.js wasn't installed correctly or its path wasn't
added to Windows.
Solution
Reinstall Node.js and restart your computer.
Error: 'npm' is not recognised
Reason
npm wasn't installed correctly.
Solution
Install the latest version of Node.js again.
Error: Port Already in Use
Reason
Another application is already using the default port.
Solution
Close the conflicting application or use the new port
provided by Vite.
Best Practices for Beginners
- Install
the latest LTS version of Node.js.
- Create
new React projects using Vite.
- Keep
VS Code updated.
- Install
useful extensions.
- Organise
your files into folders.
- Use
meaningful component names.
- Save
your work regularly.
- Practice
by building small projects.
- Learn
one concept at a time.
- Write
clean and readable code.
Interview Questions
- What
is React?
- Why
do we need Node.js for React?
- What
is npm?
- What
is Vite?
- What
is the purpose of the src folder?
- What
is App.jsx?
- What
is main.jsx?
- How
do you start a React development server?
- Which
command installs project dependencies?
- What
is the difference between React and Node.js?
- Why
is VS Code popular among React developers?
- What
is Git, and why is it useful?
Conclusion
Setting up your React development environment is the
first and most important step in your React journey. By installing Node.js, VS
Code, Git, and creating a project with Vite, you build a strong foundation for
learning modern frontend development.
Once your environment is ready, you can start exploring JSX, components, props, state, hooks, routing, API integration, and many other React concepts. As you continue practising and building projects, you'll gain the confidence to create professional web applications and prepare yourself for internships, freelance work, or a career as a React developer.
Comments
Post a Comment