How to Download and Install React Router (Step by Step)
Every way to get React Router running: one npm command, a new Framework Mode app, or an offline install from the downloaded package, with checks at each step.
Read MoreMost React Router install problems are not bugs. They are version mismatches: an older Node.js, an older React, or a tool that expects CommonJS. This page lists the React Router requirements for the current release, compares them with earlier major versions, and covers the tools around it so you can check your setup before installing anything.
Facts on this page come from the published packages and were last checked on 1 December 2026, when React Router 8.5.3 was the latest release.
| Requirement | Minimum | How to check |
|---|---|---|
| React | 19.2.7 | npm ls react |
| React DOM | 19.2.7 | npm ls react-dom |
| Node.js | 22.22.0 | node -v |
| Module system | ES modules | "type": "module" in package.json, or a bundler |
| TypeScript (optional) | Types included; Framework tooling supports TS 5.1 to 7 | npx tsc -v |
| Vite (Framework Mode only) | 7 or 8 | npm ls vite |
React's type packages (@types/react and @types/react-dom 19.2+) are optional peer dependencies. You only need them in TypeScript projects.
If you cannot meet the v8 requirements yet, an earlier major version may fit your stack. Here is how they compare:
| Version | React | Node.js | Package to install | Status |
|---|---|---|---|---|
| v8 (8.5.3) | 19.2.7+ | 22.22.0+ | react-router | Current |
| v7 (7.18.7) | 18+ | 20+ | react-router (or react-router-dom) | Maintained |
| v6 (6.30.x) | 16.8+ | 14+ | react-router-dom | Older line |
The practical rule: React 19 projects should use v8, React 18 projects should use v7, and anything older should plan a React upgrade before touching the router.
You might think Node.js only matters on a server. But your package manager, Vite, the dev server and the production build all run on Node.js. React Router 8's packages declare "node": ">=22.22.0", so npm prints an EBADENGINE warning on older versions, and the Framework Mode tooling can fail outright. In Framework Mode with server rendering, Node.js also runs your app in production.
If you host on a platform that picks a Node.js version for you (many serverless platforms do), set it explicitly to 22 or newer in the platform settings or with an "engines" field in your own package.json.
React Router 8 is published as ES modules only. For most projects this changes nothing: Vite, modern webpack, Rspack, esbuild and Parcel all handle ESM natively, and current Node.js can load ES modules from CommonJS.
Where it can bite is older test setups. If a Jest configuration does not transform ES modules, you may see SyntaxError: Cannot use import statement outside a module. The usual fixes are switching to Vitest, or configuring Jest's ESM support and adjusting transformIgnorePatterns so react-router is transformed.
@react-router/dev, which supports Vite 7 and Vite 8.exports field.@types package for React Router.React Router is platform-independent JavaScript. Development works the same on Windows 10 and 11, macOS and any mainstream Linux distribution, on both x64 and ARM (including Apple silicon). On Windows, both PowerShell and WSL work; WSL tends to give faster file watching on large projects.
Any editor with good TypeScript support works well. VS Code, WebStorm, Zed and Neovim with a TypeScript language server all give you autocomplete for route APIs, and in Framework Mode they pick up the generated route types automatically.
Apps built with React Router run in all current browsers: Chrome, Edge, Firefox and Safari on desktop, plus Chrome on Android and Safari on iOS. Client-side navigation relies on the standard History API, which every modern browser supports. Internet Explorer is not supported by React 19, so it is not supported here either.
| Hosting type | Works? | Notes |
|---|---|---|
| Static hosting (SPA) | Yes | Configure a fallback so every path serves index.html. |
| Node.js server | Yes | Framework Mode SSR via @react-router/serve or your own Express server. |
| Serverless and edge platforms | Yes | Community and official adapters exist for the major platforms; Cloudflare Workers is supported by the tooling. |
| Shared PHP hosting | SPA only | Upload the built static files and add a rewrite rule to index.html. |
If your stack is below the v8 minimums, upgrade in this order so each step is easy to test:
.nvmrc or .node-version file to the project so teammates use the same version. Re-run your build and tests.npm i react@latest react-dom@latest. React 19 removed some long-deprecated APIs, so read its upgrade notes and fix warnings before going further.Upgrading one layer at a time means that when something breaks, you know exactly which change caused it.
Local machines are not the only place versions drift. Build servers often run an older Node.js image than your laptop. Pin the version in your CI configuration (for example node-version: 22 in a GitHub Actions setup step) and add an "engines" field to your own package.json:
"engines": {
"node": ">=22.22.0"
}
Combined with npm config set engine-strict true, installs on an unsupported Node.js version fail immediately with a clear message instead of producing a broken build later.
React Router 7 and 8 target the web. The old react-router-native package stopped at the v6 line, so for React Native apps a native navigation library is the better choice.
node -v # needs v22.22.0 or newer
npm ls react # needs 19.2.7 or newer for v8
npm ls react-dom # same as react
npm ls vite # Framework Mode: 7.x or 8.x
All good? Follow How to Download and Install React Router to install it. If the install still fails, React Router not working? Common errors and fixes walks through the exact error messages.
Planning an upgrade between major versions? React Router versions and updates explains what changed in v7 and v8 and how to move safely.
Get React Router 8.5.3: one npm command, or the verified package download.
DownloadRelated articles
Every way to get React Router running: one npm command, a new Framework Mode app, or an offline install from the downloaded package, with checks at each step.
Read MoreBuild a small multi-page React app from scratch and learn Routes, Link, NavLink, Outlet, useParams and useNavigate along the way.
Read MoreA plain-English tour of what React Router can do, from nested layouts and URL params to loaders, actions, type-safe routes and server rendering.
Read More