I am having trouble with creating react app - node.js

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.

Related

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

npm Err Exit handler never called

$ npx create-react-app my-app
Creating a new React app in /data/data/com.termux/files/home/my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! Exit handler never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://github.com/npm/cli/issues
npm ERR! A complete log of this run can be found in:
npm ERR! /data/data/com.termux/files/home/.npm/_logs/2021-10-11T17_09_35_089Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... node_modules
Deleting generated file... package.json
Deleting my-app/ from /data/data/com.termux/files/home
Done.
Simply downgrade your npm version to npm6 by running this command in node-
npm install -g npm#6
This will solve your issue because I have this same issue and downgrading my npm version solved it.
i had the same problem npm install --no-package-lock solved it for me.
If it doesn't work try to delete the package-lock.json and then npm install
Remove package-lock.json and than run: npm i, it should work.

npx package installation failure due to socket time out how do if fix this

C:\Users\norine>npx create-react-app react-dapp
Creating a new React app in C:\Users\norine\react-dapp.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! errno ERR_SOCKET_TIMEOUT
npm ERR! request to https://registry.npmjs.org/#babel/code-frame/-/code-frame-7.10.4.tgz failed, reason: Socket timeout
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\norine\AppData\Local\npm-cache_logs\2021-06-05T05_33_42_735Z-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 react-dapp/ from C:\Users\norine
Done.
Try this
npm config set registry="http://registry.npmjs.org/"
Or
sudo npm cache clean -f
npm update
Install yarn globally with using npm
npm i -g yarn#latest
then try,
yarn create react-app app_name

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.

create-react-app and npm install webpack error : maximum call stack size exceeded

Both create-react-app and npm install webpack(webpack is failing. Other packages installation worked) give "Maximum call stack size exceeded" error. Tried "npm cache clean --force", deleted package-lock, did reinstall on npm (npm install), npm rebuild, upgrade node and npm to recent stable versions (Node:8.12.0 & NPM:6.4.1 ). Inspite of all that error still exists.
create-react-app demo-app gives below error
Creating a new React app in D:\Projects\demo-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
npm ERR! Maximum call stack size exceeded
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\mkatti\AppData\Roaming\npm-cache\_logs\2018-10-08T07_21_50
_853Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts
has failed.
Deleting generated file... package.json
Deleting demo-app / from D:\Projects
Done.
npm install webpack --save-dev gives below error
npm WARN registry Using stale data from https://registry.npmjs.org/ because the
host is inaccessible -- are you offline?
npm WARN registry Using stale package data from https://registry.npmjs.org/ due
to a request error during revalidation.
npm ERR! Maximum call stack size exceeded
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\mkatti\AppData\Roaming\npm-cache\_logs\2018-10-08T07_28_07
_840Z-debug.log

Resources