react-scripts is the core package underpinning Create React App (CRA), providing the fundamental configuration and scripts (start, build, test, eject) for React applications without requiring manual Webpack, Babel, ESLint, or Jest setup. The current stable version is 5.0.1, released in April 2022. Historically, major versions were released approximately annually, with maintenance patches in between. Key differentiators include its 'zero-configuration' approach, abstracting away complex build tooling, and offering a consistent development experience. While highly popular for rapid prototyping and learning, Create React App, and by extension `react-scripts`, is now in a maintenance state and is no longer recommended for new projects, which are encouraged to use alternative build tools like Vite or Next.js.
npm install react-scriptsNo compatibility data collected yet for this library.
Demonstrates how to initialize a new Create React App project using `npx create-react-app` and how to use the `react-scripts` CLI commands (`start`, `build`, `test`) for common development workflows, along with a minimal TypeScript React component example.
Review the official Create React App release notes for v5.0.0 and update any custom configurations, ESLint plugins, or Jest setups to be compatible with the new major versions of these tools. Consider removing `react-app-rewired` if experiencing issues.
Update your `src/index.js` (or `.tsx`) file to use the new React 18 root API: `import { createRoot } from 'react-dom/client'; const root = createRoot(document.getElementById('root')!); root.render(<App />);`For new projects, consider using alternative build tools. For existing projects, be aware that active feature development for react-scripts is limited, focusing primarily on critical bug fixes and security updates. Plan for potential migration if future React versions introduce major incompatibilities.
Ensure your project's Babel configuration aligns with the new JSX transform. If Fast Refresh isn't working, check for custom Webpack configurations or `react-app-rewired` setups that might interfere with Webpack HMR.
Ensure your development environment uses Node.js version 14.0.0 or newer. You can use tools like nvm (Node Version Manager) or volta to manage multiple Node.js versions and switch to a compatible one.
Upgrade your Node.js version to 14.0.0 or higher. Use nvm (e.g., `nvm install 16 && nvm use 16`) or volta to manage your Node.js environment.
Ensure you have `react` and `react-dom` versions 18.x installed (`npm install react react-dom`) and that `react-scripts` is at least `5.0.1`. Then, update your `src/index.js` or `src/index.tsx` to use `import { createRoot } from 'react-dom/client';`.Review your project's ESLint configuration (e.g., `.eslintrc.json` if ejected or created one). For `no-unused-vars`, consider explicit unused variable prefixes. For parsing errors, ensure your ESLint parser supports modern JS/TS syntax and react-scripts' default config is not overly overridden.
Remove or update any custom Webpack configurations or libraries like `react-app-rewired` that modify the default react-scripts behavior, as they might be incompatible with Webpack 5. Refer to the Webpack 5 migration guide if manual intervention is required.