Setting Up React Environment
Install Node.js and npm, pick an editor, and get familiar with the tools you will use throughout this React course.
Introduction
Before you can write a single line of React, you need a working development environment. That means a JavaScript runtime to power your build tools, a package manager to install libraries, a code editor that understands modern JavaScript and JSX, and a browser with the right debugging tools installed.
This lesson walks through every piece of that setup. By the end, you will have Node.js and npm installed and verified, an editor configured for React development, a clear picture of the tooling landscape (npm, yarn, pnpm, Vite), and a preview of the browser tools you will lean on constantly once you start writing components.
- How to install Node.js and npm, and how to verify the install.
- How to choose and configure a code editor for React.
- The difference between npm, yarn, and pnpm.
- Why Vite is the modern standard build tool, and how it compares to the legacy Create React App.
- A first look at browser DevTools and the React Developer Tools extension.
Installing Node.js and npm
React itself is just a JavaScript library, but the tools that build, bundle, and run React projects — Vite, ESLint, and countless packages from npm — all run on Node.js. Node.js is a JavaScript runtime that lets JavaScript execute outside the browser, on your own machine.
Head to nodejs.org and download the LTS (Long Term Support) version — it is the most stable release and the one recommended for almost everyone. The installer for Windows, macOS, and Linux bundles npm (Node Package Manager) automatically, so you get both tools in a single install.
node --version
# v20.11.1
npm --version
# 10.2.4v20.11.1
10.2.4If either command prints "command not found", close and reopen your terminal after installing — many terminals only pick up new PATH entries on a fresh session. On Windows, restarting your computer after installation is sometimes needed as well.
Choosing a Code Editor
You can technically write React in any text editor, but a proper code editor makes a huge difference: syntax highlighting for JSX, autocomplete, inline error checking, and one-click formatting all save you time and catch mistakes early. Visual Studio Code (VS Code) has become the de facto standard for React development — it is free, fast, cross-platform, and has an enormous extension ecosystem.
ES7+ React/Redux Snippets
Type shortcuts like "rafce" to instantly scaffold a function component.
Prettier - Code Formatter
Automatically formats your code on save so style stays consistent.
ESLint
Flags bugs and style issues directly in the editor as you type.
Auto Rename Tag
Renaming an opening JSX tag automatically renames its matching closing tag.
Bracket Pair Colorization
Built into VS Code — makes nested JSX and JavaScript brackets easy to trace visually.
Path Intellisense
Autocompletes file paths when importing your own components.
Package Managers: npm, yarn, pnpm
A package manager installs and manages the third-party code your project depends on — React itself, build tools, and any library you add later. npm ships with Node.js by default, so it is what most tutorials (including this course) use, but you will encounter alternatives in real-world projects.
npm
The default package manager bundled with Node.js. Universally supported and the safest choice while learning.
yarn
Created by Meta as a faster, more secure alternative to early npm. Very similar commands, still widely used.
pnpm
Saves disk space by storing one copy of each package version and linking it across projects. Popular for large, multi-project setups.
You do not need to master all three right now — this course uses npm throughout. Just know that if you join a team using yarn or pnpm, the commands map almost one-to-one (for example, "npm install" becomes "yarn" or "pnpm install").
Vite vs Create React App
To turn JSX and modern JavaScript into something a browser can run, React projects need a build tool. For years, the official starting point was Create React App (CRA). Today, the React team itself recommends against starting new projects with CRA, and the community has moved to faster, more modern tools — chief among them, Vite.
Vite (Modern Standard)
- Starts a dev server almost instantly, even on large projects.
- Uses native ES modules during development for near-instant Hot Module Replacement.
- Actively maintained and recommended by the React team.
- What this course uses for every project.
Create React App (Legacy)
- Slow startup and rebuild times on anything but tiny projects.
- No longer actively maintained; officially deprecated by the React team in 2025.
- Still found in older tutorials and existing codebases.
- Not recommended for new projects.
Browser DevTools & React Developer Tools
Every modern browser ships with built-in Developer Tools (open with F12 or right-click → Inspect) for viewing the DOM, checking network requests, and reading console output. On top of that, you will want the React Developer Tools browser extension, available for Chrome, Edge, and Firefox.
This extension adds two new panels — "Components" and "Profiler" — that let you inspect your component tree, view live props and state, and measure rendering performance. You do not need to install or use it deeply yet; a full lesson later in this course is dedicated entirely to React Developer Tools. For now, just know it exists and is worth installing early.
A dedicated lesson will walk through the React Developer Tools extension in depth — inspecting props and state live, and profiling component renders. This section is just a preview so the name sounds familiar when you get there.
Common Mistakes
- Installing a very old or "Current" (non-LTS) Node.js version — stick to the LTS release for stability.
- Forgetting to restart the terminal (or computer) after installing Node.js, then assuming the install failed.
- Mixing package managers in one project (for example, running both npm and yarn), which can create conflicting lock files.
- Starting a brand-new project with Create React App from an outdated tutorial instead of Vite.
Best Practices
- Always install the LTS version of Node.js unless you have a specific reason not to.
- Pick one package manager per project and stick with it for that project's lifetime.
- Install the ESLint and Prettier extensions early — they catch mistakes long before you run your code.
- Use Vite for all new React projects; treat Create React App as legacy knowledge only.
- Install the React Developer Tools extension now, even if you will not use it fully until later.
Frequently Asked Questions
Do I need to know the terminal to learn React?
You need to be comfortable running a handful of basic commands like cd, npm install, and npm run dev. You do not need to be a command-line expert.
Can I use React without installing Node.js?
For real projects, no — Vite and virtually every React tool require Node.js to run. Some online playgrounds (like CodeSandbox or StackBlitz) let you try React in the browser without installing anything, which is fine for quick experiments.
Is VS Code required, or can I use another editor?
VS Code is recommended because of its huge React ecosystem, but editors like WebStorm or even Sublime Text with the right plugins can work too.
What is the difference between npm and Node.js?
Node.js is the runtime that executes JavaScript outside the browser. npm is the package manager, bundled with Node.js, that installs and manages libraries for your project.
Should I learn Create React App at all?
Not for new projects. It is useful only to recognize if you encounter it in an older codebase or tutorial; all new work should use Vite.
Key Takeaways
- Node.js and npm are required to run the build tools behind every React project.
- Verify your install with "node --version" and "npm --version".
- VS Code, with a few key extensions, is the recommended editor for React development.
- npm, yarn, and pnpm are interchangeable package managers with very similar commands.
- Vite is the modern standard build tool for React; Create React App is legacy and no longer recommended.
- The React Developer Tools browser extension will become essential once you start building components.
Summary
A solid development environment removes friction so you can focus on learning React itself. With Node.js and npm installed, an editor configured for JSX, and an understanding of the tooling landscape, you are ready to actually create a project.
In this lesson, you installed and verified Node.js and npm, picked a code editor, learned how npm compares to yarn and pnpm, and saw why Vite has replaced Create React App as the modern standard. Next, you will use these tools to scaffold and run your very first React application.
- Node.js and npm are installed and verified on your machine.
- You have a code editor configured for React development.
- You understand the difference between npm, yarn, and pnpm.
- You know why Vite is preferred over Create React App today.