npx create-react-app NOT working. Getting "outdated version of create-react-app" error

Viewed 1766

Please help. I've tried all what people have done already. I ran the commands below step by step as follows...

node -v 
v17.3.0
npm -v
8.3.1
npx -v
8.3.1
yarn -v
1.22.17
npm uninstall -g create-react-app
yarn remove global create-react-app
npm cache clean -f
npm i -g npm@latest
npx clear-npx-cache
npx create-react-app@5.0.0

Been dealing with this bug for quite some time. Nobody has been able to solve it thus far.

Again, I cannot do npx create-react-app. It creates package.json file but not the template. I get the "need to uninstall global create-react-app" error. Windows 10 machine. Using bash inside VsCode.

I feel that up a directory or two, there is some hidden create-react-app file. But I've been the admin and ran these commands from the root directory C:/users/admin.

Does not work using yarn either.

It worked once I uninstalled nodejs and re-installed it again but then it starts error again later.

2 Answers

Try doing this - install the latest react app modules locally in the working directory by using:

npm install create-react-app@latest

and then:

npx create-react-app my-app

Runnning create-react-app with potential errors npx create-react-app myapp You are running create-react-app 4.0.0, which is behind the latest release (4.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.

Run creact-react-app using 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.

Upgrading npm npm install -g npm@latest ( just wanted to post this for anybody who is having issues with npx create-react-app myapp.) I found this solved my problem

Related