getting error while trying to create a react app - reactjs

I used to create react apps with the facebook's github repo and it worked each time, but this time it is not working. Because I'm getting this error and I can't find the reason behind it. I've already tried to do the cache clean.
> core-js#2.6.12 postinstall C:\Users\user\Desktop\cryptohello\node_modules\babel-runtime\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
The system cannot find the path specified.
npm ERR! code ELIFECYCLE
npm ERR! errno 3
npm ERR! core-js#2.6.12 postinstall: `node -e "try{require('./postinstall')}catch(e){}"`
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the core-js#2.6.12 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Roaming\npm-cache\_logs\2021-08-15T16_48_09_293Z-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 cryptohello/ from C:\Users\user\Desktop
Done.

The problem is you haven't support of fork, exec and bash in cmd in windows, please try with GIT Bash

Related

How can I install React using NPM?

I can't install react using npm for some reason, I can't figure out what the problem is. Does anyone know a solution to this problem? I uninstalled npm and tried again but it didn't help and tried other things. but it doesn't help me.
stalling react, react-dom, and react-scripts with cra-template...
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\darslar\imtihon-app\node_modules\tailwindcss\oxide-node-api-shim/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\darslar\imtihon-app\node_modules\tailwindcss\oxide-node-api-shim\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Local\npm-cache\_logs\2023-02-08T15_57_28_764Z-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
node:fs:1226
return handleErrorFromBinding(ctx);
^
Error: EBUSY: resource busy or locked, rmdir '\\?\D:\darslar\imtihon-app'
at rmdirSync (node:fs:1226:10)
at _rmdirSync (node:internal/fs/rimraf:235:5)
at rimrafSync (node:internal/fs/rimraf:193:7)
at Object.rmSync (node:fs:1275:10)
at Object.removeSync (C:\Users\User\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\fs-extra\lib\remove\index.js:15:28)
at C:\Users\User\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:539:14
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
errno: -4082,
syscall: 'rmdir',
code: 'EBUSY',
}
Node.js v18.12.0
Try these steps:
Delete package-lock.json and run NPM again.
Ensure no other processes of node.js are running (check task manager)
If you are using visual studio code, close it and try running npm install again.
You can also check the following issue page: https://github.com/npm/npm/issues/17444
https://github.com/tailwindlabs/tailwindcss/issues/10534#issuecomment-1422896616
Basically you need update npm to latest version
npm install -g npm#latest
Delete package-lock.json and node_modules and launch
npm i
It was a problem with dependency of cra. Whole world couldn`t install react for one hour.

npm start issue working on react and next .js

I just cloned code from a GitHub repository.
I tried to run it with the following command
'next' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nextjs#0.1.0 start: `next start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nextjs#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\DELL\AppData\Roaming\npm-cache\_logs\2021-10-12T12_27_53_876Z-debug.log
PS F:\REACT\projectnamme> node -v
v12.16.1
PS F:\REACT\projectnamme> npm -v
6.13.4
F:\REACT\projectnamme> create-react-app --version
3.4.1
first of all, you need to download your node_modules
you can use npm install or yarn install
then do npm start or yarn start in your terminal

React-bootstrap not installing due to husky error

I am trying to install react-bootstrap.
Yesterday I managed to successfully install react-bootstrap but I then later uninstalled it. Today I tried to reinstall it in the same project but it gives me the bellow errors.
I then created a new react app as a test in order to try and install react-bootstrap, but it failed with the same errors.
It seems that there is an issue relating to husky, so I installed this package but that did not help either.
I am using macOS.
noahgwynn#Noah frontend % npm i react-bootstrap
npm ERR! code 127
npm ERR! path /Users/noahgwynn/Documents/code/udemy-mern/frontend/node_modules/#popperjs/core
npm ERR! command failed
npm ERR! command sh -c husky install .config/husky
npm ERR! sh: husky: command not found
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/noahgwynn/.npm/_logs/2021-02-20T19_52_28_911Z-debug.log
noahgwynn#Noah frontend % npm install --save react-bootstrap
npm ERR! code 127
npm ERR! path /Users/noahgwynn/Documents/code/udemy-mern/frontend/node_modules/#popperjs/core
npm ERR! command failed
npm ERR! command sh -c husky install .config/husky
npm ERR! sh: husky: command not found
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/noahgwynn/.npm/_logs/2021-02-20T19_55_15_427Z-debug.log
noahgwynn#Noah frontend %
Your help is appreciated.
EDIT: Problem fixed!
Just tried "npm i react-bootstrap" again and this time it worked. It's a couple of hours later, not sure what changed but I'm happy it did.

Error While running the project in vs code

I'm new to react native. I'm trying to run the project i'm running the cmd 'npm install' But it is showing error.
D:\vox-android>npm install
npm WARN deprecated object-keys#0.2.0: Please update to the latest object-keys
npm ERR! code ENOGIT
npm ERR! Error while executing:
npm ERR! undefined ls-remote -h -t ssh://git#github.com/tradle/react-native-http.git
npm ERR!
npm ERR! undefined
npm ERR! No git binary found in $PATH
npm ERR!
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\kisuser\AppData\Roaming\npm-cache\_logs\2018-12-19T09_22_40_673Z-debug.log

Installing create-react-app gives npm ERR! shasum check failed and npm ERR! Unexpected end of JSON input while parsing near '...mojOzGIEI2rg0m24Yb5Oq'

Errors when i use sudo npm install create-react-app -g
npm ERR! Linux 4.13.0-39-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "i" "create-react-app" "-g"
npm ERR! node v6.11.4
npm ERR! npm v3.5.2
npm ERR! shasum check failed for /tmp/npm-16477-77596b49/registry.npmjs.org/tar/-/tar-2.2.1.tgz
npm ERR! Expected: 8e4d2a256c0e2185c6b18ad694aec968b83cb1d1
npm ERR! Actual: 5eb06eb521673d0940a4deb11baf89d62647f193
npm ERR! From: https://registry.npmjs.org/tar/-/tar-2.2.1.tgz
when use npm install create-react-app
- npm-version : 6.0.0
- node-version: 8.11.1
error is:
npm ERR! Unexpected end of JSON input while parsing near '...mojOzGIEI2rg0m24Yb5Oq'
npm ERR! A complete log of this run can be found in:
npm ERR! /home/dilipcoder/.npm/_logs/2018-05-05T11_34_14_721Z-debug.log
i have already tried these options
npm cache clean --force
reinstalling npm and node
switching different version of npm
error which I get while installing create-react-app other packages installed properly
the error npm ERR! shasum check failed and npm ERR! Unexpected end of JSON input while parsing near'....' , will be solved by switching npm reigistry from the list of given npm registry.
List of Npm registry:
https://registry.npmjs.org/ (Dfault One)
http://r.cnpmjs.org/
https://registry.npm.taobao.org/
https://registry.nodejitsu.com/
http://registry.mirror.cqupt.edu.cn
https://skimdb.npmjs.com/registry
https://npm.open-registry.dev/ (https://open-registry.dev)
To switch just type
npm config set registry "https://registry.npmjs.com/"
Replace the registry url with the above urls check which one works for you.
After That:
npm cache clear --force
npm cache verify
now error will be solved.
"npm cache clean --force" didn't work for me but removing package-lock.json worked.
https://github.com/vuejs-templates/webpack/issues/990#issuecomment-395750082
Error:
SyntaxError: Unexpected end of JSON input while parsing near
Removing package-lock.json worked for me.
Add Powershell script or Linux script as below,
Powershell:
Remove-Item package-lock.json -Force
Linux:
rm -rf package-lock.json
Path In Azure Devops:
$(System.DefaultWorkingDirectory)\appName\appName\ClientApp\node_modules'
Note - appName is an example you can add a path as per your source code.

Resources