I am getting error while making React app - node.js

When I try to make a React app using npx create-react-app amazon
It shows me
Creating a new React app in E:\React\amazon.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! Unexpected end of JSON input while parsing near '...totype.trimstart":"^1'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\SVG\AppData\Roaming\npm-cache\_logs\2020-10-16T06_12_32_500Z-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 amazon/ from E:\React
Done.
Thanks

Ok it got fixed I had to uninstall node.js, delete all folders and re-install node.js and it worked!

Related

I am having trouble with creating react app

i was trying to create a new react project but i faced errors i never seen before i tried npm cache clean --force it said npm WARN using --force Recommended protections disabled. so i tried this
npm cache verify
it responded with
it Cache verified and compressed (~\AppData\Local\npm-cache\_cacache)
Content verified: 0 (0 bytes)
Index entries: 0
Finished in 0.013s
but i still cant create react app using the command npx create-react-app projectName
it just responds with
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code FETCH_ERROR
npm ERR! errno FETCH_ERROR
npm ERR! invalid json response body at https://registry.npmjs.org/html-entities reason: Invalid response body while trying to fetch https://registry.npmjs.org/html-entities: Socket timeout
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\u4\AppData\Local\npm-cache\_logs\2023-01-04T11_43_21_180Z-debug-0.log
Aborting installation.
npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... package.json
Deleting travel/ from C:\Users\u4\Desktop\code
Done.
i updated my node thinking that may be the problem but still no change HELP!!
so i found the source to my problem. first i runed npm -g list and it only had npm no create-react-app so you need to install it using npm install -g create-react-app. check it by running npm -g list if successfully installed create-react-app will be their. now you can run npx create-react-app projctname with out a problem.

While I'm trying to create React app this particular error is coming

C:\Users\souvik das>cd documents
C:\Users\souvik das\Documents>npx create-react-app blog
Creating a new React app in C:\Users\souvik das\Documents\blog.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code ERR_SSL_CIPHER_OPERATION_FAILED
npm ERR! errno ERR_SSL_CIPHER_OPERATION_FAILED
npm ERR! Invalid response body while trying to fetch https://registry.npmjs.org/react-dom: F42A0000:error:1C800066:Provider routines:ossl_gcm_stream_update:cipher operation failed:c:\ws\deps\openssl\openssl\providers\implementations\ciphers\ciphercommon_gcm.c:312:
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\souvik das\AppData\Local\npm-cache\_logs\2022-05-04T16_20_42_133Z-debug-0.log
Aborting installation.
npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... package.json
Deleting blog/ from C:\Users\souvik das\Documents
Done.
have you tried updating the package by using npm update create-react-app?
I solved the issue , just go to windows settings -> Network reset -> reset now
and hit the reset .. and restart your PC . it worked for me
Got the same Provider routines:ossl_gcm_stream_update:cipher operation failed error on Node 18 with npm 8.x during npm install. Running the below command worked for me.
npm cache verify

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

npm ERR! Unexpected end of JSON input while parsing near '..."jscs":"~3.0.7","moch'

I have a problem with npm. I tried: npx create-react-app my-app but it returned an error.
My command prompt output:
c:\Users\sysli\Desktop\reactprojects>npx create-react-app my-app
npx: installed 91 in 34.825s
Creating a new React app in c:\Users\sysli\Desktop\reactprojects\my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! Unexpected end of JSON input while parsing near '..."jscs":"~3.0.7","moch'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\sysli\AppData\Roaming\npm-cache\_logs\2019-12-26T21_21_02_198Z-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 c:\Users\sysli\Desktop\reactprojects
Done.
Log file:
https://justpaste.it/3s5ym
Update npm on your machine (Prasool advice):
sudo npm i -g npm
If it does not work as expected, please use
npm cache clean --force
as it seems to work for some around here and GitHub. :)
Have a happy coding time!
Can you retry after updating npm?
npm install -g npm
Please note that this command will remove your current version of npm. Make sure to use
sudo npm install -g npm if on a Mac.

Resources