'sh' is not recognized as an internal or external command
Asked Answered
D

3

15

Creating a new React app in E:\rn-starter\my-app.

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

'sh' is not recognized as an internal or external command, operable program or batch file.

Aborting installation. npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.

Deleting generated file... package.json Deleting my-app/ from E:\rn-starter Done.

This error pops-up whenever I try to create a new react project or react native project. tried re-installing node and

Dowse answered 23/11, 2020 at 16:59 Comment(2)
have you checked this one : https://mcmap.net/q/92451/-sh-react-scripts-command-not-found-after-running-npm-start/5669120 ?Prolongation
That does not solve my problemDowse
D
46

I was using windows command prompt to do this. Using the git bash resolved the problem for me. The issue I think was with sh - shell files not being recognized by default in windows. However with git bash, since it by default recognizes the shell scripts it did work perfectly.

Dowse answered 23/12, 2020 at 8:32 Comment(2)
Good answer but it is not perfect :\Jump
@Jump this may not be the perfect answer. this is just the solution I found to be working for me.Dowse
G
1

You could try using the terminal of the IDE you are using instead of the windows cli...

Gynecocracy answered 16/4, 2022 at 8:5 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Unhand
O
1

Using the git bash works, but you could also add git (bin folder) to your Path environment variable if you want to run shell scripts in windows terminal.

Default installation path for git is: C:\Program Files\Git

enter image description here enter image description here

Otherworld answered 25/9, 2023 at 12:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.