OpenSSH Username for ‘https://github‘报错弹窗与hexo d部署博客到github时报错:Error: Spawn failed解决办法

一、问题描述

1.基于Hexo+Github搭建个人博客,当到了最后关键时刻用hexo d  部署博客到github的仓库时

反复弹出对话框

OpenSSH Username for 'https://github'
Password for 'https://你的github邮箱@github.com'

二、排查步骤

1.在自己建立的博客目录内按住键盘Shift键,点击鼠标右键打开Git Bash Here ,

输入ssh -T git@github.com   查看返回结果

输入以下命令查看返回结果
$ ssh -T git@github.com

 

以下结果说明git与github绑定成功,否则失败
Hi 这里为自己的github用户名! You've successfully authenticated, but GitHub does not provide shell access.

三、在Git Bash Here里面输入此语句npm install hexo-deployer-git --save  安装Git部署插件,输入命令:

返回:

up to date in 2m

28 packages are looking for funding
  run `npm fund` for details

不用管

输入以下语句
$ npm install hexo-deployer-git --save

返回以下结果,不用管
up to date in 2m

28 packages are looking for funding
  run `npm fund` for details
Git Bash执行

$ hexo clean

正确返回结果
INFO  Validating config
INFO  Deleted database.
INFO  Deleted public folder.
Git Bash执行

$ hexo g

正确初始化结果
INFO  Validating config
INFO  Start processing
INFO  Files loaded in 532 ms
INFO  Generated: archives/2024/index.html
INFO  Generated: archives/index.html
INFO  Generated: archives/2024/01/index.html
INFO  Generated: index.html
INFO  Generated: css/style.css
INFO  Generated: fancybox/jquery.fancybox.min.css
INFO  Generated: fancybox/jquery.fancybox.min.js
INFO  Generated: js/script.js
INFO  Generated: js/jquery-3.6.4.min.js
INFO  Generated: css/images/banner.jpg
INFO  Generated: 2024/01/09/hello-world/index.html
INFO  11 files generated in 550 ms

 四、当执行以下命hexo d部署博客到github时报错:Error: Spawn failed

当执行以下命令时报错Error: Spawn failed
$ hexo d

报错内容如下

Error: Spawn failed

五、解决方法如下:

1. 用编辑器打开你所创建的博客目录内的_config.yml配置文件进行以下修改

把自己的github的https仓库地址》——>《换成自己github的SSH地址

把原来github仓库的https地址用##号注释掉


重大注意事项:


       type:后面有空格隔开
       repo:后面有空格隔开
       branch:后面有空格隔开

原有的为这样
deploy:
  type: git
  repository: https://自己的github的https仓库地址.io.git
  branch: main

修改后的为这样
deploy:
  type: git
  ##repository: https://自己的github的https仓库地址.io.git
  repo: 这里换成自己github的SSH地址.io.git
  branch: main

把原来github仓库的https地址用##号注释掉
注意事项:
       type:后面有空格隔开
       repo:后面有空格隔开
       branch:后面有空格隔开

 

 

 

 

 

  • 16
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值