After spending hours on many recommendations that did not work. I finally got npx create-react-app
running by doing the following:
Uninstall npm by running the following code at your command prompt:
npm uninstall -g create-react-app
Increase timeout by changing/adding this line in your .npmrc file:
timeout=60000; prefer-offline=true;
Your .npmrc file can be found in
C:\Program Files\nodejs\node_modules\npm
(windows)Then RESTART your PC
Disable your antivirus (as @Antoine said)
Run the following at the command prompt
npm clean cache --force npm install create-react-app npx create-react-app my-app
where
my-app
is the name of your project
NOTE: I am not using any proxy.
CLICK HERE to find out more related problems solutions.