Creating a New React App Takes Hours Without Success - node.js

I'm using Windows 10 and I have Node.js v12.14.1 and npm 6.13.4.
I tried npx create-react-app my-app and npm init react-app my-app
Both took forever without creating the app.
All I could see was
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
After that nothing showed up in the command line.
But it does create tons of files, I was able to see node_modules folder and package.json. Deleting those thousands of files also took a long time...
How can I solve this problem? I also tried npm cache clean --force but it didn't help.

If you've previously installed create-react-app globally via npm install -g create-react-app, we recommend you uninstall the packages using npm uninstall - create-react-app to ensure that npx always uses the latest version.
To create a new app, you may choose one of the following methods:
npx
npx create-react-app my-app
npm
npm init react-app my-app
Yarn
yarn create react-app my-app
It automatically installs node_modules and it is fine to show this log on the terminal.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
Best,

Related

Cannot cannot create app using npx create-react-app appname

this is the error i am facing while creating react app.
I had tried below solution but it doesnot work for me
updated my npm using below command
npm i -g npm#latest
npm cache clear --force
yarn cache clear
npx create-react-app myapp --use-npm
I also check .npmrc folder in C:user>me> but still it not working
Node version
v16.15.0
Npm version
8.13.0
you don't need to use --use-npm
Simply use
npx create-react-app app-name

How to fix npm ENOENT error in create-react-app?

I'm trying to create-react-app but it's showing error
I've tried
npm cache clean --force
npx create-react-app .
Also used this but same issue occurs
npm install -g create-react-app
can anyone suggest how to fix this?
npx is used for the libraries in node_modules in your project
Since you used -g (meaning global) to install create react app you should use
npm create-react-app
If you add create-react-app to your package json with
npm install create-react-app
you can then use npx to run the command.
Check if your create react app version is compatible with your machine's node version. Upgrade or downgrade accordingly to match the two. This fixed the issue at my machine.

React App not install,show error abortion installation

node --version => 14.5.0
npm --version => 6.14.6
create-react-app --version => 3.4.1
yarn --version => 1.22.4
I tried all ways to solve this problem but all in vain. I reinstall node update every thing also consult stackoverflow but i am unable to solve this....please help me....
Welcome to StackOverflow.
If you, by any luck visited the create-react-app GitHub repository.
You could have found that the create-react-app as a package is not deprecated, and thus you have to use the npx thing over here.
create-react-app officially asks you to uninstall create-react-app and use the npx script.
First, uninstall create-react-app
npm uninstall -g create-react-app
And then simple run the following command to create a new react-app
npx create-react-app my-app
Then you can change directory to my-app and run it using npm.
cd my-app
npm start

I am getting this error when I try to run react app with npm?

Getting this error when trying to run the react app with expo,
Tried running npm install expo-cli --global and also has package.json file.
I'd suggest using yarn. it's much better than npm.
I was having a lot of problems with npm as well when I try to run the app or install any packages.
install yarn using
npm install yarn -g

problem with install and creat my first react app

here is the img description of the error
first it creates the folder (my-app), but after a few seconds it will be removed automatically. Either I installed the latest version of node.js.
$ npx create-react-app my-app
npx : 98 installé(s) en 23.154s
Creating a new React app in D:\Mon-Travail-Personnel\my-work-with-REACT\my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
until know it's good but after :
**
npm ERR! Unexpected end of JSON input while parsing near '...rg\r\n\r\nwsFcBAEBCAA'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\khith\AppData\Roaming\npm-cache_logs\2020-05-29T16_51_36_753Z-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 my-app/ from D:\Mon-Travail-Personnel\my-work-with-REACT
Done.
**
Could you try this,
Clear cache: npm cache clean --force
Install create-react-app globally: npm i create-react-app -g
Create your React project: create-react-app my-app
The problem should mostly be resolved with Step 1.

Resources