Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update ReactJS's `create-react-app`?

The ReactJS docs stated we can use

npx create-react-app my-app

to create a React app. But how do we update the create-react-app? Is there a general rule if it is something started by npx? I keep on clicking on some links and reached the site https://create-react-app.dev/ and it has a line:

npm install react-scripts@latest

but I wonder if I run it, it is not -g (global), so will it let us create a React app in any folder? Also when I ran it, it gave:

found 6289 vulnerabilities (4974 low, 306 moderate, 1004 high, 5 critical)

so there seems to be something that needs to be done extra.

like image 581
nonopolarity Avatar asked Mar 15 '20 03:03

nonopolarity


People also ask

How do I update my create React app?

To update your React version, install the latest versions of the react and react-dom packages by running npm install react@latest react-dom@latest . If you use create-react-app , also update the version of react-scripts . Copied! The command will update the versions of the react-related packages.

What is the latest version of create React app?

v5. 0.0 (2021-12-14) Create React App 5.0 is a major release with several new features and the latest version of all major dependencies.


1 Answers

ERR:You are running create-react-app 4.0.1, which is behind the latest release (4.0.3).

npm install -g create-react-app

This updates it to latest version globally. And then you can run 'npx create-react-app appname'

like image 97
Vishala Ramasamy Avatar answered Oct 23 '22 03:10

Vishala Ramasamy