Home > OS >  I am not able to initialize create-react-app for some strange reason
I am not able to initialize create-react-app for some strange reason

Time:12-20

create-reate-app is not initializing even I tried everything which was mentioned to get started in react official documentation. I tried following commands:

npx create-react-app my-app

then I recieved this ** You are running create-react-app 4.0.3, which is behind the latest release (5.0.0).

We no longer support global installation of Create React App.

Please remove any global installs with one of the following commands:

  • npm uninstall -g create-react-app
  • yarn global remove create-react-app

The latest instructions for creating a new app can be found here: https://create-react-app.dev/docs/getting-started/ ** then I run:

npm uninstall -g create-react-app

but still when I repeat npx create-react-app, I recieved the response which I pasted above in bold. I also tried

npm init react-app my-app

I have repeated all of this for more than 3 times but it didn't worked now please tell me what's the problem :(

CodePudding user response:

This issue while tried creating new react app with create-react-app, but related to some random JSON reading issues while installations like.. >= 5.0 || 4.0 ..

But the fix below solves multiple and similar issues.

First of all, make sure you have required or latest version of node installed.

npm install npm@latest -g

Before using create-react-app make sure you clean npm cache using

npm cache clean --force

Now, is should be fine to create new react app with

npx create-react-app tl-app or npx create-react-app 

if you want to create current directory as project root.

  • Related