npm ERR! cb() never called, on windows10 while creating first react project

Viewed 1403

While creating first react app using command "create-react-app myfirstapp", I got the following errors:

D:\ReactProject>create-react-app myfirstapp

Creating a new React app in D:\ReactProject\myfirstapp.

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\intex\AppData\Roaming\npm-cache\_logs\2021-02-19T07_57_36_091Z-debug.log

Aborting installation.

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

Deleting generated file... package.json

Deleting myfirstapp/ from D:\ReactProject

Installed ReactJS version is:

D:\ReactProject>create-react-app --version
4.0.2

Installed Node version is:

D:\ReactProject>node -v
v14.15.5

Note: This is first time I am creating ReactJS app on Windows machine, so installed NodeJS first time on this machine and tried to create the react app and got the above errors.

Please let me know your suggestions on fixing these errors.

Also, find attached screenshot of the above. enter image description here

2 Answers

I tried couple of things, but the following worked for me.

I run this command "npm install --global windows-build-tools" using Administrative privileges and it worked for me.

I tried on windows 10 just now. I used PowerShell Window. Simple, go to your project directory -> hold the shift button and click the right mouse button -> select 'Open PowerShell window here' -> start in that cmd. It works for me.

Related