Create React App (CRA) is an official command-line interface (CLI) tool for quickly setting up new single-page React applications with zero build configuration. It abstracts away the complex setup of tools like Webpack, Babel, ESLint, and Jest, providing a pre-configured development environment out of the box. The latest version is 5.1.0, though significant updates were last documented in 5.0.1 (April 2022). CRA includes major upgrades to underlying tooling like webpack 5, Jest 27, ESLint 8, and PostCSS 8, along with support for React 18's `createRoot` API and Fast Refresh. While once the primary tool for new React projects, it is now officially deprecated for new applications and in maintenance mode, receiving only critical bug fixes and updates to support newer React versions. It differentiates itself by offering a fully managed, opinionated build setup, aiming for simplicity and a consistent developer experience, making it historically ideal for learning React or starting new projects without extensive build tooling knowledge.
npm install create-react-appNo compatibility data collected yet for this library.
Demonstrates how to scaffold a new React application using `npx` and start its development server, including an example for TypeScript.
For new projects, consider alternatives like Vite (for simple SPAs), Next.js (for SSR/SSG), or Remix. For existing projects, consider a migration, especially if new features or significant performance improvements are needed.
Ensure Node.js is updated to version 14 or higher. For existing projects, update `react-scripts` to `5.0.0` or later and address any breaking changes in custom configurations or linting rules. Deleting `node_modules` and reinstalling dependencies (e.g., `npm install`) might be necessary.
Update `react-scripts` to version 5.0.1 or higher. Change `ReactDOM.render(<App />, document.getElementById('root'))` to `ReactDOM.createRoot(document.getElementById('root')).render(<App />)` in `src/index.js`.Avoid ejecting unless absolutely necessary. For most customization needs, `craco` or `react-app-rewired` can provide a less destructive alternative. If you must eject, ensure you have a clear understanding of the underlying build tools and a backup of your project.
Ensure your Node.js version is 14.0.0 or later. Use a Node Version Manager (like `nvm` or `nvm-windows`) to easily switch and manage Node.js versions.
Ensure `npx` is available (comes with npm 5.2+). The recommended way to create a new app is `npx create-react-app my-app`. If you prefer a global install, run `npm install -g create-react-app` (though this is discouraged now).
Delete the `node_modules` directory and `package-lock.json` (or `yarn.lock`), then run `npm install` (or `yarn install`) to reinstall dependencies cleanly. Updating `react-scripts` to the latest compatible version is also advised.
Upgrade your Node.js version to 14.0.0 or later. Use `nvm install 16` (or desired LTS) and `nvm use 16` to manage Node versions.
Ensure all project dependencies, especially `react-scripts`, `eslint-config-react-app`, and related ESLint plugins, are updated to their latest compatible versions. Review custom ESLint configurations for breaking changes introduced in ESLint 8. Deleting `node_modules` and reinstalling can sometimes help.
No dependency data recorded yet.