Getting error on npm start create-react-app - node.js

I am currently learning React. I have done:
npm i -g create-react-app (sucessful)
create-react-app react-app (sucessful)
cd react-app
npm start (error above)
Output:
npm start \Git\cmd was unexpected .at this time.
npm ERR! code ELIFECYCLE
So, what I have tried by searching online:
npm cache clean --force
delete node_modules
delete package-lock.json
npm run clear
npm install
None solved. I have read that I should not installed globally but now that it is already instaled (?) can I rollback? I can't run npm i g create-react-app again.
Thank you
Edit: Added screenshot
https://i.ibb.co/mNKLskX/Capturar.png

with npm try init
npm init react-app my-app
or, try npx:
npx create-react-app my-app
cd my-app
npm start

Have you tried to follow the steps from 'create-react-app'?
`To create a new app, you may choose one of the following methods:
npx
npx create-react-app my-app
(npx comes with npm 5.2+ and higher, see instructions for older npm versions)
npm
npm init react-app my-app
npm init is available in npm 6+
Yarn
yarn create react-app my-app
yarn create is available in Yarn 0.25+`
To have more info: https://github.com/facebook/create-react-app

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

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.

Why do I keep receiving an error when trying to install my react app

This is my first time trying out React and it's very demoralising to keep seeing the same error over and over again. I tried all three of these codes seperately
npx create-react-app myapp
npm init react-app myapp
npm install -g create-react-app then create-react-app myapp
All which gave me:
npm ERR! Unexpected end of JSON input while parsing near '...:"^5.0.0 || ^6.0.0"},'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\{hiddenForPrivacyReasons}\AppData\Roaming\npm-cache\_logs\2020-04-18T14_12_44_513Z-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:\{hiddenForPrivacyReasons}\codes\app
Done.
Help!!!
You don't need react-app and other scripts
Simply:
npx create-react-app my-app
cd my-app
npm start
Refer: document of create-react-app

Install for [ 'create-react-app#latest' ] failed with code 1

I have installed node version 12.6.1 on the windows machine.
I have been trying to create react app on my machine using the following command:-
npx create-eact-app my-app
the error:-
npm ERR! code ENOLOCAL
npm ERR! Could not install from "Ahmad\AppData\Roaming\npm-cache\_npx\2904" as it does not contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Saood Ahmad\AppData\Roaming\npm-cache\_logs\2020-03-01T06_56_47_636Z-debug.log
Install for [ 'create-react-app#latest' ] failed with code 1
screenshot error screen shot
please guide me through
Thanks
this error occurred because you have a space in your username.
you can solve this problem by installing create-react-app globally:
npm install -g create-react-app
then simply run:
create-react-app my-app
(be carefull you have a typo in your explanation:
npx create-eact-app my-app => npx create-react-app my-app
This can be solved by making sure you install create-react-app in your machine.
Run the following commands, either you install create-react-app globally or not
npm install create-react-app
or
npm install -g create-react-app

npm ERR! Unexpected end of JSON input while parsing near '.../openpgpjs.org\r\n\r\'

I am a newbie to React and trying to start a project
npm version: 6.4.1
create-react-app version: 2.1.8
node version: 10.15.0
I run create-react-app newApp , And got error:
npm ERR! Unexpected end of JSON input while parsing near '.../openpgpjs.org\r\n\r\'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ThunderF\AppData\Roaming\npm-cache_logs\2019-04-> 06T18_16_37_841Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.
I faced the same issue but I wrote the following line and it worked.
npm cache clean --force
I got the same problem and I ran these commands
1) npm cache clean --force
2) restart your machine
3) npx create-react-app my-app
(or)
npm install create-react-app enter and then npm init react-app my-app
cd my-app
npm start

Resources