'Error then trying create-react-app( npm ERR! cb() never called! then trying create-react-app)
Have some troubles then trying create react app
PS D:\Projects\Test> npx create-react-app my-app
Creating a new React app in D:\Projects\Test\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\semen\AppData\Roaming\npm-cache\_logs\2022-01-05T05_29_35_153Z-debug.log
Aborting installation.
npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
I reinstalled nodejs few times. Made downgrade nodejs to 14.18.1 version. Tryed to used Yarn. But this soltushions dont work in my situation. I use Windows 10. Thanks for help!
Solution 1:[1]
I had the same error after I created my React app and couldn't install any more packages.
- Try clearing your cache with
npm cache verifyornpm cache clean --force. - If that doesn't work, then try doing a clean install of npm using:
npm clean-install.
Solution 2:[2]
This error has happened to me before and I have followed these steps, I hope it works for you too. The first thing you need to do is to uninstall the create-react-app and then npm install it again. You can use these commands for uninstalling the create-react-app: if you are using NPM:
npm uninstall -g create-react-app
if you are using Yarn:
yarn global remove create-react-app
for creating a new app you can use the following command:
npx create-react-app@latest your-project-name
You must notice that the create-react-app should not be installed globally as it is documented in Create-React-app Docs.
Also please note that it is safe to say, always use the LTS version of node (that is 16.13.2 at this time).
It should solve your problem with initiating a new react app.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Amith C |
| Solution 2 | Shayan Faghani |
