执行Hexo d报错Spawn failed, 以及OpenSSL SSL_read: Connection was reset, errno 10054

今天在重新整理自己用hexo搭建的Homepage,
但是当我使用hexo d 命令将我的文件传到github上的时候报了以下错误

$ hexo d
INFO  Deploying: git
INFO  Clearing .deploy_git folder...
INFO  Copying files from public folder...
INFO  Copying files from extend dirs...
warning: LF will be replaced by CRLF in 2021/03/18/index/index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in CNAME.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in archives/2021/03/index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in archives/2021/index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in archives/index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in css/index.css.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in css/user.css.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in gallery/index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in home/index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in js/main.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in research/index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in software/index.html.
The file will have its original line endings in your working directory
On branch master
nothing to commit, working tree clean
fatal: unable to access  'https://github.com/Candlelight-XYJ/Candlelight-XYJ.github.io.git/': OpenSSL  SSL_read: Connection was reset, errno 10054
FATAL Something's wrong. Maybe you can find the solution here:  https://hexo.io/docs/troubleshooting.html
Error: Spawn failed
    at ChildProcess.<anonymous>  (D:\StudyMaterials\8_FileManagement\testBlog\blog\node_modules\hexo-util\lib\spawn.js:51:21)
    at ChildProcess.emit (events.js:314:20)
    at ChildProcess.cp.emit  (D:\StudyMaterials\8_FileManagement\testBlog\blog\node_modules\cross-spawn\lib\enoent.js:34:29)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

不知道是不是太久没用gitbash了,我的本地和github的连接已经失效,查阅了一堆方案后,
我解决此问题的步骤如下:

(1)首先,我重新生成了本地电脑和Github链接的SSH的公钥KEY, 将本地电脑和GitHub重新连接

git config --global user.name "your github user name"
git config --global user.email "your github 注册邮箱"

上述代码执行后,生成公钥

ssh-keygen -t rsa -C "your github 注册邮箱"

此时公钥保存在 C:\Users\ .ssh 的文件夹下,打开id_rsa.pub文件,将里面的内容全部复制; 然后去GitHub的Settings, 找到SSH and GPG keys的页面, 新建一个SSH Key, 将刚才复制的内容粘贴到新建的SSH Key中并点击保存。

保存后输入以下代码检测SSH Key生效

ssh git@github.com

如果出现下面的文字,则本地和Github远程连接上了

PTY allocation request failed on channel 0
Hi zhangsan! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.

(2)按照链接: https://github.com/hexojs/hexo/issues/2778 中的方法,我执行了以下代码

hexo config deploy.repository git@github.com:[yourgitname]/[yourgitname].github.io.git

(3)再次执行 hexo d 就没有报错啦 ~
文件成功上传 😊

  • 10
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值