我是靠谱客的博主 虚拟冬天,这篇文章主要介绍hexo 部署时遇到的坑,现在分享给大家,希望可以做个参考。

https://hexo.io/zh-cn/docs/

 

报错spawn git ENOENT

Error: spawn git ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
at child_process.js:1144:20)
at process._tickCallback (node.js:355:11)

未添加Git环境变量引起,添加Git与git管理库的环境变量即可;

D:Gitbin;D:Gitlibexecgit-core

设置完毕后强制更新环境变量,或者重启电脑~

读取不到Git分支

Please make sure you have the correct access rights
and the repository exists.
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io
cs/troubleshooting.html
Error: fatal: 'github.com/pyrinelaw/pyrinelaw.github.io.git' does not appear
be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

读取不到github上的分支,使用Hexo之前是有使用Git操作过Github的,所以不大可能是Git安装的问题。

ssh -v git@github.com

显示ssh连接github成功,说明Git安装正确。
卸载Git重新安装,错误继续出现。搁置了一天,中午午休的时候网上逛论坛,发现了此问题。原来是我的Git版本太新的缘故。。。
卸载Git 2.5版本,安装1.9版本,问题解决-_-

处理:
把_config.yml文件中repository: https://github.com/andybroker/andybroker.github.io.git 这个地址改为git@github.com:andybroker/andybroker.github.io.git
把_config.yml中的repository 改了成了ssh,
deploy:
type: git
repository: ssh://git@github.com/xiaoliuzi/xiaoliuzi.github.io
branch: master

最后

以上就是虚拟冬天最近收集整理的关于hexo 部署时遇到的坑的全部内容,更多相关hexo内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(124)

评论列表共有 0 条评论

立即
投稿
返回
顶部