How to update the create react app to its latest version?

Viewed 64

I am trying to update the create-react-app to its latest version. In the docs, they have mentioned using the below command to update the react scripts to 5.0.0.

sudo npm i create-react-app@5.0.0

I wonder if there is any way to update create-react-app to its latest stable released version without knowing the exact version.

1 Answers

Updating your an existing project build tooling is typically a daunting and time-consuming task. When new versions of Create React App are released, you can upgrade using a single command:

npm install react-scripts@latest

In most cases bumping the react-scripts version in package.json and running npm install (or yarn install) should be enough.


When you run npx create-react-app my-app it automatically installs the latest version of Create React App.

Create React App creates the project with the latest version of react-scripts so you’ll get all the new features and improvements in newly created apps automatically.

If you've previously installed create-react-app globally via npm install -g create-react-app, we recommend you uninstall the package using npm uninstall -g create-react-app or yarn global remove create-react-app to ensure that npx always uses the latest version.

Reference: https://create-react-app.dev/docs/updating-to-new-releases

Related