Reputation: 231
I am trying to create my-app using create-react-app. Below error is seen
create-react-app my-app
Creating a new React app in C:\Users\racrk\React\my-app.
Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts...
[email protected] postinstall C:\Users\racrk\React\my-app\node_modules\babel-runtime\node_modules\core-js node scripts/postinstall || echo "ignore"
npm ERR! file C:\Program Files\git\bin\bash.exe
npm ERR! path C:\Program Files\git\bin\bash.exe
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn C:\Program Files\git\bin\bash.exe
npm ERR! [email protected] postinstall: node scripts/postinstall || echo "ignore"
npm ERR! spawn C:\Program Files\git\bin\bash.exe ENOENT
npm ERR!
npm ERR! Failed at the [email protected] 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\racrk\AppData\Roaming\npm-cache_logs\2019-09-25T07_06_05_990Z-debug.log
Aborting installation. npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.
Upvotes: 1
Views: 1386
Reputation: 127
Make sure a bash executable actually exists at the path output by npm. You can update the path that npm uses for the script shell using:
npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe"
or check your current script-shell with:
npm config get script-shell
You can read more here
Upvotes: 1
Reputation: 530
npm don't like the space in C:\Program Files\git\bin\bash.exe
when he try to spawn bash
try to change the location of bash.exe
in a path without space
don't forget to update your PATH
env
Upvotes: 2