DEV Community

Abhi Gattineni
Abhi Gattineni

Posted on

Unable to create a new reactjs application using npm.

there is an warning while installing create-react-app extension. When trying to create a new application, i am facing this issue.

Top comments (6)

Collapse
 
andrewsnapz profile image
Andrew Shin

Hey Abhi,
I think the issue is that your missing Git bash:

npm ERR! core-js@2.6.11 postinstall: node -e "try{require('./postinstall')}catch(e){}"
npm ERR! spawn C:\Program Files\git\bin\bash.exe ENOENT

ENOENT stands for "No such file or directory". So what I think is happening is, its trying to install core-js@2.6.11 using git bash. Git bash is unix command-line shell that installs unix commands that's not found on window devices.

Open up File explorer -> OS(C:) -> Program Files -> Git -> bin
and see if your have bash installed. If not : stanleyulili.com/git/how-to-instal...

Then try running the command again.

Hopefully this helps!

Collapse
 
fralainbk profile image
Franck Binde

You can also try :

npm init react-app your-app

Collapse
 
abhigattineni1 profile image
Abhi Gattineni

Hi franck, facing same error for this command too.

C:\Users\abhis>npm init react-app my-app1

Creating a new React app in C:\Users\abhis\my-app1.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

core-js@2.6.11 postinstall C:\Users\abhis\my-app1\node_modules\babel-runtime\node_modules\core-js
node -e "try{require('./postinstall')}catch(e){}"

npm ERR! code ELIFECYCLE
npm ERR! syscall spawn C:\Program Files\git\bin\bash.exe
npm ERR! file C:\Program Files\git\bin\bash.exe
npm ERR! path C:\Program Files\git\bin\bash.exe
npm ERR! errno ENOENT
npm ERR! core-js@2.6.11 postinstall: node -e "try{require('./postinstall')}catch(e){}"
npm ERR! spawn C:\Program Files\git\bin\bash.exe ENOENT
npm ERR!
npm ERR! Failed at the core-js@2.6.11 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\abhis\AppData\Roaming\npm-cache_logs\2020-08-14T21_27_12_459Z-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 my-app1 / from C:\Users\abhis
Done.

Collapse
 
fralainbk profile image
Franck Binde

Hi Abhi. Well, I am sending you a link that I hope might be useful. Creating react apps could be tricky sometimes. We often have to try different things before making it work. Here is the link...

stackoverflow.com/questions/478430...

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
abhigattineni1 profile image
Abhi Gattineni

hi makhuvha, no change when using npx.