4

Don't know what happened but I receive the following error while

>npx create-react-app .
>npm i <packages>
>npm install 

and so on, so none of the commands above work

the error:

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! [email protected] 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 [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I've seen that it's mostly Windows problem but I work with Mac

3 Answers 3

6

Open CMD as administrator and then run:

npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe"
Sign up to request clarification or add additional context in comments.

Comments

1

https://github.com/facebook/create-react-app/issues/8441 this might help you. Might be because of the wrong bash!

Comments

0

I just had run npm config set script-shell "C:\Program Files\git\bin\bash.exe"

1 Comment

this is a duplicate of another answer, how is this helpful?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.