Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot create a React app with create-react-app

I am facing a problem with creating a new React app using CRA when I run the following command npx create-react-app my-app.

  • I tried to clear npm cache with this command npm cache clean --force
  • I also tried this command npm -g uninstall create-react-app

My node version is v14.15.3 and the npm version is 7.10.0
The error which I get is :

Need to install the following packages:
  create-react-app
Ok to proceed? (y)
like image 438
Oussama Bouchikhi Avatar asked Apr 23 '21 16:04

Oussama Bouchikhi


People also ask

Why cant I use NPX create React app?

We no longer support global installation of Create React App. The current solution is simple — run create-react-app and target the latest version. 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.

Can I use npm With create React app?

Create React App is a comfortable environment for learning React, and is the best way to start building a new single-page application in React. npx on the first line is not a typo — it's a package runner tool that comes with npm 5.2+.

How do you check if Create React app is installed?

The other method is also straightforward, you can check the React app version by heading over to node_modules/react/cjs/react. development. js. You can see the react project version in the commented section as showing given below.


Video Answer


1 Answers

Need to clear the cache on the npx:

npx clear-npx-cache

and then re-run

npx create-react-app <app-name>

and then accept (y)

like image 53
snewn Avatar answered Nov 15 '22 09:11

snewn