当我尝试将我的react应用程序部署到github页面时,我运行了npm run deploy
。它成功构建,但是在部署时出现以下错误:
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.
我的git remote -v
返回:
origin https://github.com/helplah/shopping-cart.git (fetch)
origin https://github.com/helplah/shopping-cart.git (push)
答案 0 :(得分:4)
我设法通过查看此处的其他答案来解决它。首先,您输入which git-upload-pack
来确定git是否可以访问它。
如果没有,则必须在Windows 7上转到控制面板->系统->高级系统设置->环境变量->编辑路径。在那儿添加git-upload-pack的路径。
git-upload-pack通常位于C:\Program Files\Git\mingw64\bin
或C:\Program Files\Git\mingw64\libexec\git-core
中。您可以在\Git\mingw64
中找到它。
我添加了两个路径,并且在重新启动计算机后对我有用。