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.
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.
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.
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'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With