Member-only story
An In-Depth Guide for Create React App 5 (CRA 5)
Details of CRA 5’s new features and new packages
Create React App (CRA) is a quick way to scaffold a React project. It can be easily generated by the command, npx create-react-app <project name>
. With one command, we have the latest packages and the execution environment for a React project. It is convenient and effective.
CRA 5 was released on Dec 14, 2021. It has the following new features and new packages:
- Dropped support for Node 10 and 12.
- Fast Refresh improvements.
- Improved package manager detection.
- Unpinned all dependencies for better compatibility with other tools.
- Started Tailwind support.
- Upgraded to Webpack 5, Jest 27, ESLint 8, and PostCSS 8.
Let’s go through these details.
Install New Create React App
create-react-app
is a global command-line utility to create new React projects. The created projects have the latest version of react-scripts
, which is currently 5.0.0. CRA 5 dropped support for Node 10 and 12, and it requires node 14 or higher. If the node version does not meet the requirement, create-react-app
will fail.
After setting the node version to 17 (14 or higher), the installation works.
Upgrade Existing Create React App
react-scripts
includes scripts and configuration. Updating the Create React App project is achieved by upgrading react-scripts
to a specific version. The official documentation recommends running the following command to upgrade to the latest version: