由于错误,无法使用具有特定项目的 gh-pages 部署到:无法生成 sh:没有这样的文件或目录 [英] Cannot deploy to with gh-pages with specific project due to error: cannot spawn sh: No such file or directory

查看:17
本文介绍了由于错误,无法使用具有特定项目的 gh-pages 部署到:无法生成 sh:没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不断收到错误:

错误:无法生成 sh:没有那个文件或目录

error: cannot spawn sh: No such file or directory

致命:无法分叉

项目构建正确,但在尝试部署我的网站时失败.网站是用create-react-app"创建的在我的 Windows 8 电脑上使用命令gh-pages -d build"

The project builds correctly but when trying to deploy my website it fails. Website was created with "create-react-app" on my windows 8 pc with the command "gh-pages -d build"

这个问题只发生在我电脑上的这个特定项目中,因为当我用create-react-app"创建一个新项目时在我的电脑上它会很好地部署.这个特定的项目也可以用gh-pages -d build"很好地部署.在我的 Mac 上,但不是我的电脑.

This issue only occurs in this specific project on my pc as when I create a new project with "create-react-app" on my pc it'll deploy fine. This specific project can also be deployed fine with "gh-pages -d build" on my mac but not my pc.

在控制台上部署失败的错误

错误日志控制台参考

存储库

我一定是搞砸了什么.我查看了网络,尝试重新安装 git、编辑器、依赖项,并且对导致这种情况的原因感到非常困惑.一定是操作系统不同吧?谢谢!

Somewhere along the line I must've messed up something. I've looked over the web, tried reinstalling git, editor, dependencies and am super confused as to what's causing this. It must be an operating system difference? Thanks!

推荐答案

它正在尝试生成 sh.exe 但找不到它.

It's trying to spawn sh.exe but can't find it.

您需要将包含 sh.exe 的 git 目录添加到您的系统变量中.

You need to add the git directory that contains sh.exe to your system variables.

(开始并输入:'path'.这应该为您提供了'系统环境变量'的快捷方式.如果没有,请查看如何在您的 Windows 版本上编辑环境变量.)

(go start and type: 'path'. This should provide you with a shortcut to 'system environment variables'. If not look up how to edit environment variables on your version of windows.)

打开环境变量对话框后,查看系统变量>路径"列表.那里可能有一个不包含 sh.exe 的 git 目录.您需要将它替换为一个(确保它也包含 git.exe).在我的电脑上发现 sh.exe 位于:

Once you have the environment variables dialogue box open, have a look in the System variables > 'path' list. There may be a git directory there that doesn't contain sh.exe. You need to replace it with one that does (ensure this also contains git.exe). On my pc sh.exe was found in:

C:Program FilesGitin

C:Program FilesGitin

完成后重启终端并尝试再次部署.

Once this is done restart the terminal and attempt to deploy again.

这篇关于由于错误,无法使用具有特定项目的 gh-pages 部署到:无法生成 sh:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆