When I'm trying to deploy my react app to github pages, I ran npm run deploy
. It managed to build but has the following errors when deploying:
git-upload-pack '.': git-upload-pack: command not found
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
My git remote -v
returns:
origin https://github.com/helplah/shopping-cart.git (fetch)
origin https://github.com/helplah/shopping-cart.git (push)
I managed to solve it by looking at other answers here. First, you type which git-upload-pack
to find out if git has access to it.
If it does not, on Windows 7 you have to go control panel -> System -> Advanced system settings -> Environment variables -> edit path. Over there add the path of git-upload-pack.
git-upload-pack is usually in C:\Program Files\Git\mingw64\bin
or C:\Program Files\Git\mingw64\libexec\git-core
. You can find it in \Git\mingw64
.
I added both paths and after restarting my computer it worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With