5

this is the problem

HP@DESKTOP-1HP83V8 MINGW64 ~/Desktop/Web-Development (master) $ npx create-react-app my-app

Creating a new React app in C:\Users\HP\Desktop\Web-Development\my-app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://npm.community

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\HP\AppData\Roaming\npm-cache_logs\2020-11-20T11_50_51_060Z-debug.log

Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts >cra-template has failed.

Filburt
  • 17,626
  • 12
  • 64
  • 115
Francis
  • 51
  • 1
  • 1
  • 2

11 Answers11

11

I've encountered this multiple times.

First I would suggest that you run npm uninstall -g create-react-app since the global version isn't supported anymore.

Then try npx create-react-app my-app again.

If that does not work, try to run:

npm init

npm install create-react-app

npx create-react-app my-app

The steps above have solved the issue for me a couple of times

idkwhatsgoingon
  • 658
  • 4
  • 22
2

Disconnect and reconnect to your source of internet (WIFI).
After that, run npm cache verify
Next you will want to run: rerun npx create

Tyler2P
  • 2,324
  • 26
  • 22
  • 31
Daniel Sogbey
  • 163
  • 1
  • 11
  • This sort of did it for me. I think my Wifi is unstable as I kept getting download error while downloading Node Windows Installer from my browser. I restarted my PC instead, and it worked somehow lol – remondo Mar 28 '21 at 11:44
  • Thus great Remondo, Great feedback – Daniel Sogbey Apr 02 '21 at 15:07
2

Working Solution: thanks to idkwhatsgoingon's answer.

create-react-app does not work globally

  1. npm uninstall -g create-react-app
  2. npm install create-react-app
  3. create-react-app app01
1

try this command first:

npm cache clean --force

and create your react app again.

1

I got the same error .Here these things i did to solve it

  1. I ran npm cache clean --force
  2. after again npx create-react-app project name
1

I tried all of these, it did not work. But I restarted the computer and it started working ! So after clearing the cache etc, might be be worth restarting the machine ( Windows 10 )

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 03 '22 at 11:23
0

I got the same error when trying to install netlify-cli. Here are two things I did to solve it:

  1. I deleted some files to clear up disk space
  2. Since my npm version is 6.0+, I ran "sudo npm cache verify"
Aye
  • 271
  • 3
  • 9
0

Add the line

timeout=60000

to your .npmrc config file (create it at ~/.npmrc if it doesn't exist) then run npx create-react-app project-name should be successful. At least it was in my case. (I had code ERR_SOCKET_TIMEOUT before)

daGo
  • 2,584
  • 26
  • 24
0

Try installing yarn. I did this and immediately fixed my issues.

npm install --global yarn
Dipo
  • 1
  • 1
0

first and foremost uninstall create-react-app by npm uninstall -g create-react-app then npm cache clean -f then npx create-react-app app-name

this worked for me

0

I run npm cache verify

After this command, I run sudo apt install rerun

Then I run the command rerun npx create-react-app <app-name>

It worked like magic