Two commands will both put React on your machine, and they leave you with very different projects. One installs the library. The other installs a framework that already has React sitting inside it.
React itself is a JavaScript library for building user interfaces. It redraws the browser only where component state actually changes, which is most of the reason people tolerate the build tooling wrapped around it.
That tooling shifted underneath everyone fairly recently. React’s team retired the once standard Create React App on February 14, 2025, and now points new projects toward tools like Vite or frameworks like Next.js instead (React, 2025). Plenty of tutorials still floating around predate that announcement, which is worth keeping in mind before you copy a command off a three year old blog post.
What Is React.js?
Meta builds it, ships it, and runs it internally. The job is narrow. Interfaces get assembled from reusable components, and the browser only updates where the underlying data actually moved.
Its current major version, React 19, arrived on December 5, 2024 (React, 2024).
Components replace full page templates, so you stop thinking in documents and start thinking in pieces. Virtual DOM diffing keeps real browser updates small. And data flows one direction only, which feels restrictive right up until you spend an evening debugging someone else’s two way bindings.
React.js sits squarely inside front-end development, handling what a person sees and clicks rather than what happens on a server.
The deeper reasoning behind picking it over other libraries is covered in why use React.js.
React Library Installation vs React Framework Installation
The starting point you pick here decides more than the first command does.
Install the library and you get react and react-dom, nothing else. Install a framework and React comes bundled with routing, data fetching, and a build config someone else already argued about.
| Path | What gets installed | Typical tool |
|---|---|---|
| Library only | react and react-dom packages | Vite |
| Framework | React plus routing, data fetching, build config | Next.js |
React’s own team confirmed this shift when it retired Create React App on February 14, 2025, pointing new projects toward frameworks or build tools instead (React, 2025).
Next.js, React Router, and Remix all wire React together with routing and data fetching ahead of time, so you never run a separate install command for React itself. It is already in there.
If you are still deciding whether React itself is the right base, React alternatives lays out the other libraries worth comparing.
My honest take is that a framework fits better for most production apps, though it does hand you opinions you did not ask for. Next.js alternatives covers the other framework choices beyond Next.js.
What Are the System Requirements to Install React.js?
Vite is the build tool behind most new React projects, and it wants Node.js 20.19 or newer, or 22.12 or newer (Vite, 2025). Anything older fails before the project even scaffolds, usually with an error message that does not immediately say “your Node is old.”
So the checklist before you start is short. You need Node.js at 20.19+ or 22.12+ and on your PATH, npm 10 or newer (which arrives bundled with Node anyway), a terminal, and an operating system. Windows, macOS, and Linux are all fully supported, so that last one is rarely the problem.
Run node -v and npm -v to confirm both are installed before moving further.
Most people pair this setup with a dedicated web development IDE. Not technically required just to install React, but nobody edits JSX in Notepad twice.
What Gets Installed When You Install React.js?

Two core packages land in your project: react and react-dom. React handles the component logic. React-dom connects that logic to the actual browser page. People sometimes forget the second one exists until they try to update only the first.
The scaffolding tool writes a few more things alongside them:
- package.json, listing every dependency and script
- package-lock.json, locking exact versions for repeatable installs
- node\_modules, the folder holding every installed package
- a src folder with an entry file such as main.jsx or index.js
Together these files form the codebase that Vite or Next.js scaffolds for you on the first run.
That entry file is written in JSX, a syntax extension that lets you write HTML like markup directly inside JavaScript. Browsers do not understand it. The build tool compiles it first, a step handled internally by Babel or esbuild depending on your setup, and you will almost never think about it again.
A React cheat sheet is worth keeping open once you start editing these files.
How Do You Install Node.js and npm for React.js?

Nothing React related runs until Node.js is installed. npm comes along automatically, so one installer handles both.
Installing Node.js and npm on Windows
- Download the Windows installer from the official Node.js site
- Run the .msi file and accept the default options, including npm
- Restart the terminal, then run node -v to confirm
The installer adds both node and npm to your system PATH automatically. Restarting the terminal matters more than it sounds like it should, since an open shell will not pick up the new PATH.
Installing Node.js and npm on macOS

You have two reasonable options on macOS.
The direct route is downloading the macOS .pkg file from the Node.js site and running it like any other app. If you already manage packages through Homebrew, brew install node does the same thing in one line and keeps upgrades in the same place as everything else.
npm installs either way, since it ships inside the Node.js package.
Installing Node.js and npm on Linux

Your distribution decides the command.
- Debian and Ubuntu: sudo apt install nodejs npm
- Fedora: sudo dnf install nodejs
- Arch: sudo pacman -S nodejs npm
Distro package versions lag behind the current release fairly often, sometimes by a lot on the more conservative ones. Check node -v against whatever Vite or Next.js expects before you assume the install worked.
Most developers pair this with a code editor. Our guide to what VS Code actually is explains why it became the default choice for React projects.
And if you would rather not switch windows constantly, you can open a terminal inside VS Code and run every command above without leaving the editor.
Which Tool Should You Use to Install React.js: Vite, Next.js, or Something Else?

Survey data here is less lopsided than the general chatter suggests. In the State of JS 2024 survey, webpack was actually the most-used build tool overall, at 85.3% usage, with Vite close behind at 78.1%, putting Vite just behind React itself, which 81.1% of respondents said they had used. Vite’s real standout result was winning the survey’s “Most Adopted Technology” award that year, for roughly 30% year-over-year growth in usage (State of JS, 2024).
That growth comes from install speed and a plugin system that mostly stays out of your way.
| Tool | Best for | Scaffold command | Default dev port |
|---|---|---|---|
| Vite | Single page apps, libraries | npm create vite@latest | 5173 |
| Next.js | Server rendering, routing built in | npx create-next-app@latest | 3000 |
| Parcel | Zero config bundling | npm init @parcel/config | 1234 |
Reach for Vite when you are building a client only interface, an internal dashboard, or a component library. Its dev server uses hot module replacement, so the browser updates without a full reload.
Next.js earns its weight once the app needs server rendering, file based routing, or an API layer sitting next to the front end. Below that threshold it is a lot of framework for not much benefit.
RSbuild is a newer entrant worth a look if your team already leans on Rspack elsewhere.
Picking a scaffolding tool is really the first decision inside your broader tech stack for web development.
Both tools also offer a TypeScript template if you plan to pair React with TypeScript from day one. Doing it later is possible. It is just tedious.
Which Package Manager Should You Use to Install React.js?

npm ships with Node.js, so it needs no separate install. Yarn, pnpm, and Bun all install React perfectly well, with different trade offs behind them.
npm is already there and needs zero setup, and it is slower than the alternatives once the dependency tree gets large.
pnpm saves real disk space through a shared package store. Every so often a package built for a flat node\_modules will misbehave under it.
Yarn has mature workspace support for multi package projects. Yarn Berry’s Plug’n’Play mode, though, can break tooling that assumes node\_modules exists on disk.
Bun posts the fastest install times of the four. It is also the newest, with the smallest production track record to point at.
For a first React.js install, npm stays the safest default since it needs nothing extra. Switch to pnpm or Bun once install speed on a larger project actually starts to annoy you.
How Do You Install React.js With Vite?

The speed gap here is not subtle. In one team’s migration benchmark, Vite’s dev server cold start was roughly 13 times faster than the retired Create React App’s, dropping from about 15.5 seconds to about 1.2 seconds on a 250 file, 30,000 line codebase (Tweag, 2024).
Fifteen seconds does not sound like much until you restart the server forty times in an afternoon.
- Run npm create vite@latest in your terminal
- Type a project name, then choose React as the framework
- Choose either the JavaScript or TypeScript variant
- Move into the new folder with cd, then run npm install
- Start the dev server with npm run dev
The dev server opens at http://localhost:5173 by default, with hot module replacement already active.
Codacy migrated its own single page application off Create React App and onto Vite, citing faster local builds and fewer dependency vulnerabilities as the main payoff (Codacy, 2026).
Once the app is running, React for beginners walks through the core concepts you will actually be writing inside that new src folder.
For the debugging side, how to debug a React app in VS Code covers breakpoints and the React Developer Tools browser extension together.
How Do You Install React.js With Next.js?
Next.js sets its bar slightly lower than Vite’s requirement covered earlier. Node.js 20.9 or newer is enough to run create-next-app, according to the framework’s own installation docs (Next.js, 2026).
- Run npx create-next-app@latest in your terminal
- Answer the prompts for TypeScript, ESLint, and Tailwind CSS
- Choose whether to use the src directory
- Confirm the App Router when asked
- Move into the folder and run npm run dev
The dev server opens at http://localhost:3000, a different port than the one Vite uses. Worth remembering if you keep both running.
Next.js remains the most used framework built on top of React.js, reported at 17.9% usage among developers worldwide (Stack Overflow Developer Survey, 2024).
Routing lives inside the app or pages folder automatically. That replaces the separate setup covered in the React Router tutorial, since a bare library install needs that extra step and a framework install does not.
If Vue’s equivalent tooling interests you more, NextJS vs Nuxt lays out that comparison directly.
Can You Install React.js Without a Build Tool?
Not the way older tutorials describe it. Starting with React 19, the React team stopped publishing the UMD script tag builds that this approach relied on, so pointing a script tag at a current version’s react.development.js file simply does not work anymore.
What that means when you actually try it:
- A script tag pointing at an unpkg URL for react@19 or later in UMD format will not resolve, since that build is no longer published
- Pinning to react@18, the last version with UMD builds, still works for quick experiments, though it is a frozen release that will not get updates
- ES module CDNs such as esm.sh let you load current React versions in the browser through an import map, which is the closer modern equivalent of the old script tag approach
The appeal of a no build setup is obvious. Nothing to install, one HTML file, fine for a demo or a single interactive widget dropped into an otherwise static page.
The costs show up quickly. Without bundling, every component ships as separate unminified code. A browser based JSX transform adds noticeable load time past a toy example. And there are no production optimizations at all, because this path was never meant for shipping.
React’s own installation guide no longer walks through a script tag setup. For trying React without installing anything, it now points people to online sandboxes such as CodeSandbox, StackBlitz, or CodePen, or to a downloadable single HTML file for local experimentation (React, official docs).
A JavaScript cheat sheet is handy here, since you are writing everything by hand without a bundler smoothing things over.
What Common Errors Happen When Installing React.js?
Installation failures cluster around a few boring causes. An old Node.js version, a permissions conflict, a port already taken by something you forgot was running.
| Error | Common cause | Fix |
|---|---|---|
| EACCES permission denied | npm installing global packages without folder access | Reinstall Node with a version manager, or reset npm’s prefix |
| Unsupported Node.js version | Node older than the tool’s minimum | Upgrade Node, then rerun node -v to confirm |
| Port already in use | Another dev server already running on 5173 or 3000 | Stop the other process, or pass a different port flag |
| Dependency conflicts | A partial or interrupted install left a broken node\_modules | Delete node\_modules and package-lock.json, then reinstall |
The official npm documentation recommends avoiding sudo entirely and instead pointing npm’s global prefix at a folder your own user account already owns (npm, official docs). Making that one change prevents most permission errors from coming back on the next install, and it took me far too long to stop reaching for sudo out of habit.
When Does Installing React.js Not Apply?
A full React.js install is the wrong move for a page that never updates itself after it loads.
Skip it when the content is static with no interactive state to manage, when you only want to test a snippet rather than build a project, when the environment has no Node.js access at all (locked down shared hosting, mostly), or when your audience is on browsers so old that modern bundlers no longer target them by default.
React’s documentation acknowledges this directly: you can try React entirely inside an online sandbox like CodeSandbox, StackBlitz, or CodePen, or by downloading a single HTML example file, without installing anything locally (React, official docs).
If what you are building is not really an interactive web app, none of this is worth the overhead. A static HTML page with some CSS loads faster and costs less to maintain than a React project babysitting content that never changes.
FAQ on How To Install React.Js
Is Create React App still a valid way to install React.js?
Not for new projects. React’s team retired it in February 2025 and stopped recommending it. Maintenance mode keeps existing apps running, but anything new started with CRA misses the faster tooling Vite and Next.js give you by default.
How do you verify that React.js installed correctly?
Start the dev server and open the local port in a browser. A working install shows the default Vite or Next.js starter page.
Running npm list react confirms react and react-dom appear in package.json without errors, which is the faster check if you are already in the terminal.
How do you check or update the installed React.js version?
npm list react inside the project folder shows the current version. To update, run npm install react@latest react-dom@latest, then check package.json again. React 19 is the current major release as of this writing.
What is the difference between npm install and npx create commands?
npm install adds a package to an existing project’s node\_modules folder.
npx create runs a scaffolding tool once, without a global install, and generates a brand new project. Vite and Next.js both follow this create pattern.
Do you need to know JSX before installing React.js?
No. Installation only needs Node.js and a terminal. JSX becomes relevant the moment you open the generated entry file and start editing components, since every React template writes its starter code in JSX by default.
What Does React.js Installation Cost to Maintain Over Time?
Almost nothing in the first few weeks. After that it settles into a routine: dependency updates through npm, the occasional major version bump like the jump to React 19, and bundler upgrades whenever Vite or Next.js ship a new major release.
Keeping that routine cheap mostly comes down to order.
- Run npm outdated before touching any config file
- Update react and react-dom together, never one without the other
- Restart the dev server and check the browser console before committing the change
Skipping a framework for a bare Vite install trades routing and data fetching decisions for a smaller initial footprint. That trade gets heavier as the project adds pages, since those decisions end up made ad hoc, usually by whoever is on the ticket that week.
Once the local setup runs cleanly, how to learn React.js covers the components, hooks, and state patterns that turn an installed project into a working application.
- C# cheat sheet - September 11, 2026
- Website Improvements That Can Support Business Growth - September 11, 2026
- What Are Android Vitals? A Simple Guide for Developers - September 10, 2026



