使用GitHub搭建Hexo博客时遇部署错误,寻求技术帮助
Hexo部署到GitHub时仓库找不到的问题
执行hexo d时出现如下错误:
fatal: repository 'https://github.com/rippleQAQ/rippleQAQ.github.io.git/' not found FATAL { err: Error: Spawn failed at ChildProcess.<anonymous> (C:\Users\HCC\Desktop\blog\myblog\node_modules\hexo-util\lib\spawn.js:51:21) at ChildProcess.emit (node:events:513:28) at cp.emit (C:\Users\HCC\Desktop\blog\myblog\node_modules\cross-spawn\lib\enoent.js:34:29) at ChildProcess._handle.onexit (node:internal/child_process:291:12) { code: 128 } } Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html
当前_config.yml的部署配置:
# Deployment ## Docs: https://hexo.io/docs/one-command-deployment deploy: type: git repo: https://github.com/rippleQAQ/rippleQAQ.github.io.git branch: master
已创建rippleQAQ.github.io仓库、配置SSH密钥,多次删除重建仓库、修改_config.yml仍未解决。
排查和解决步骤
- 将
_config.yml中的repo地址替换为SSH格式:git@github.com:rippleQAQ/rippleQAQ.github.io.git,利用已配置的SSH密钥避免HTTPS的认证或网络问题 - 验证SSH连接有效性,在Git Bash中执行
ssh -T git@github.com,返回包含用户名的欢迎信息则说明SSH配置正常,否则重新检查密钥是否正确添加到GitHub账户 - 清理Hexo缓存后重新部署,执行命令:
hexo clean && hexo g && hexo d - 确认仓库名称完全匹配(GitHub仓库名区分大小写),且你是仓库的拥有者
- 若问题依旧,删除博客目录下的
.deploy_git文件夹,再重新执行部署命令
内容的提问来源于stack exchange,提问作者rippleQAQ
相关产品推荐
相关产品推荐

