Error creating react app using create-react-app my-app - reactjs

C: \Users›create-react-app my-app
Creating a new React app
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template
npm ERR! code E403
mpm ERR! 403 403 Forbidden- GET https://registry.npmjs.org/open/-/open-8.4.0.t
npm ERE: 46B In most cases, you or one of your dependencies are requesting
mpm ERR! 403 a package version that is forbidden by your security policy, or
npm ERR! 403 on a server you do not have access to.
npm ERR! A complete log of this run can be found in:
Aborting installation.
pm install
--no-audit
--save
--save-exact
--loglevel error react react-dom re
Deleting generated file...
Deleting my-app/ from C: \Users
Done.
package, json

if you are trying to create a new react-app first of all make sure your node version is 14 or above then use
npx create-react-app your-app-name
for more details please visit documentation

Related

Not able to setup react project using create-react-app

Below is the error I am getting after running the command
C:\Users\parde>npx create-react-app app
Creating a new React app in C:\Users\parde\app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC
npm ERR! errno ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC
npm ERR! Invalid response body while trying to fetch https://registry.npmjs.org/#babel%2fcore: 10552:error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:677:
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\parde\AppData\Local\npm-cache\_logs\2022-09-09T13_12_40_326Z-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 app/ from C:\Users\parde
Done.C:\Users\parde>npx create-react-app app
I tried:
Run npm cache clean --force
Then Run npx create-react-app (project name)
This seems to be a network-related error. Have a look at this thread.
Try any of the following:
use a VPN
allow NodeJs in the firewall
update your npm npm install --location=global
reinstall NodeJs
Theirs an issue related to it in the NPM repo
Seen to be something about the windows defender firewall
https://github.com/nodejs/help/issues/3815

how to resolve socket timeout while creating react app

PS C:\Users\HP\Desktop> npx create-react-app enda_react
Creating a new React app in C:\Users\HP\Desktop\enda_react.
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/bfj failed, reason: Socket timeout
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\HP\AppData\Local\npm-cache_logs\2021-03-10T03_17_13_731Z-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 enda_react/ from C:\Users\HP\Desktop
Done.
i tried different methods such as
- increase timeout,
-upadate npm versions,
-unistalled previeous create app and installed new one,
-cleared cache,
all these methods doesnt worked for me,someone please help
I've faced the same issue in node V16.14.0, then I've added a timeout flag to solve this issue.
npx create-react-app clients -timeout=100000
I had the same problem, then I decided to install react js with this command:
npm init react-app app-name

I am trying to start a new react project But I am getting this error and the app is not created. I have installed react globally

(base) mukund#mukund-Inspiron-15-3567:~$ create-react-app todo-app
Creating a new React app in /home/mukund/todo-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 '...{"babel-core":"^6.0.0'
npm ERR! A complete log of this run can be found in:
npm ERR! /home/mukund/.npm/_logs/2020-05-10T14_41_17_724Z-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 todo-app/ from /home/mukund
Done.
Creating an app like the recommended way by the core React team at reactjs.org should solve the problem.
Do this:
npx create-react-app todo-app
If that is still not working then run the following to clear your npm cache before trying the step above again:
npm cache clean --force
This just gives you a clean reset incase your cached modules are conflicting with each other.

cannot create a new react project using create-react-app

I am trying to create a new react project with create-react-app but each time it fails because of this error.......
I am using npm version 6.3.0 and node version 10.8.0
I don't know what to do............
Creating a new React app in C:\Users\Demonblade\Desktop\test.
Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts...
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://npm.community>
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Demonblade\AppData\Roaming\npm-cache\_logs\2018-08-09T15_27_48_357Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.
Deleting generated file... node_modules
Deleting generated file... package.json
Deleting test / from C:\Users\Demonblade\Desktop
Done.
Use npx (it comes with npm 5.2+).
From the react docs:
You’ll need to have Node >= 6 and npm >= 5.2 on your machine. To
create a project, run:
npx create-react-app my-app
cd my-app
npm start

executing create-react-app gives an error

I get the following error when I run create-react-app my-new-app. My npm version is 6.1.0 and node version is 8.11.3
$ create-react-app my-new-app
Creating a new React app in C:\Users\home\Desktop\Web Development\7.
React\my-new-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
npm ERR! Unexpected end of JSON input while parsing near '...ectories":
{},"dist"
:{'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\home\AppData\Roaming\npm-cache\_logs\2018-06-
16T12_46_38_1
22Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-
scripts
has failed.
Deleting generated file... package.json
Deleting my-new-app / from C:\Users\home\Desktop\Web Development\7. React
Done.
Try the below command:
npm cache clean --force
Maybe you have an outdated create-react-app version.
If you have npm 6, then you also have npx. Using npx you can just do:
npx create-react-app my-new-app
And it will use the latest create-react-app, even if you don't have it installed.
Check the documentation

Resources