{"id":14509,"library":"create-react-app","title":"Create React App","description":"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.","status":"deprecated","version":"5.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/facebook/create-react-app","tags":["javascript","react"],"install":[{"cmd":"npm install create-react-app","lang":"bash","label":"npm"},{"cmd":"yarn add create-react-app","lang":"bash","label":"yarn"},{"cmd":"pnpm add create-react-app","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[],"quickstart":{"code":"npx create-react-app my-new-app\ncd my-new-app\nnpm start\n\n// To create a TypeScript project:\nnpx create-react-app my-ts-app --template typescript\ncd my-ts-app\nnpm start","lang":"javascript","description":"Demonstrates how to scaffold a new React application using `npx` and start its development server, including an example for TypeScript."},"warnings":[{"fix":"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.","message":"Create React App (CRA) is officially deprecated for new projects and is in maintenance mode. The React team now recommends using modern frameworks like Next.js, Remix, or build tools like Vite for new applications, which offer better performance and more features.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"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.","message":"Version 5.0.0 introduced significant dependency upgrades including webpack 5, Jest 27, ESLint 8, and PostCSS 8. This also dropped support for Node.js 10 and 12, requiring Node.js 14 or higher. Custom configurations or older tooling might break.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"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`.","message":"Create React App 5.0.1 introduced improvements for React 18 compatibility, including updating templates to use `createRoot` instead of `ReactDOM.render`. Projects upgrading to React 18 with older `react-scripts` versions will need to manually update their `index.js` file.","severity":"breaking","affected_versions":">=5.0.1"},{"fix":"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.","message":"The `eject` command is a one-way operation that permanently removes the managed build configuration, exposing all Webpack, Babel, ESLint, and other configuration files. Once ejected, you are responsible for maintaining and updating all build tooling yourself, and you cannot easily revert to the managed CRA setup.","severity":"gotcha","affected_versions":"All versions"},{"fix":"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.","message":"Using an outdated Node.js version (below 14) with Create React App 5.x will lead to installation failures or runtime errors, as it explicitly dropped support for Node 10 and 12.","severity":"gotcha","affected_versions":">=5.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"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).","cause":"`create-react-app` was not installed globally, or `npx` (the recommended method) is not available or working correctly.","error":"`create-react-app` is not recognized as an internal or external command"},{"fix":"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.","cause":"This usually indicates a corrupted `node_modules` directory or an incompatibility between `react-scripts` and other project dependencies, often after an upgrade.","error":"Failed to compile. Module not found: Error: Can't resolve 'react'"},{"fix":"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.","cause":"The installed Node.js version on your system is older than the minimum requirement for Create React App 5.x.","error":"You are running Node 12.x.x. Create React App requires Node 14 or higher."},{"fix":"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.","cause":"Often encountered after upgrading `react-scripts` to v5.0.0, particularly due to changes in ESLint 8 or Babel configuration, leading to issues with default exports or module interoperability.","error":"TypeError: (0 , _some_module.default) is not a function"}],"ecosystem":"npm"}