4
votes

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.

6
Try deleting the package-lock.json and the node_modules folder and do a npm installDivakar Rajesh
Thanks for the helpFrancis

6 Answers

8
votes

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

2
votes

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

2
votes

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
votes

try this command first:

npm cache clean --force

and create your react app again.

0
votes

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"
0
votes

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)