If you’ve ever used create-react-app as a global installation or through npx, but was previously on version 4.x.x of create-react-app/react-scripts, then you may notice an error when you run the command below, as it tries to use the latest version (5.x.x as of this writing).
npx create-react-app myapp
You are running create-react-app 4.x.x, which is behind the latest release (5.0.1). We no longer support global installation of Create React App.
The current solution is simple — run create-react-app and target the latest version.
npx create-react-app@latest myapp
Different versions of npm may help as well, and you can upgrade using the following command. Please note that this may affect other projects on your system.
npm install -g npm@latest