【解决一个Hexo deploy报错问题】

参考 解决一个Hexo deploy报错问题

部署hexo博客到github时报错如下

~/jiangcheng-pages $ hexo d -g
INFO  Validating config
INFO  Start processing
WARN  ===============================================================
WARN  ========================= ATTENTION! ==========================
WARN  ===============================================================
WARN   NexT repository is moving here: https://github.com/theme-next
WARN  ===============================================================
WARN   It's rebase to v6.0.0 and future maintenance will resume there
WARN  ===============================================================
INFO  Files loaded in 803 ms
INFO  0 files generated in 55 ms
INFO  Deploying: git
INFO  Clearing .deploy_git folder...
INFO  Copying files from public folder...
INFO  Copying files from extend dirs...
On branch master
nothing to commit, working tree clean
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
Error: Spawn failed
    at ChildProcess.<anonymous> (/data/data/com.termux/files/home/jiangcheng-pages/node_modules/hexo-util/lib/spawn.js:51:21)
    at ChildProcess.emit (node:events:511:28)
    at ChildProcess._handle.onexit (node:internal/child_process:293:12)

按网上很多网友推荐的不断的重试hexo d命令并没有解决问题,猜想可能是ssh公钥不匹配的问题,然后比较了本地id_rsa.pub与github上个人配置的sshkey,发现名字一样,但是隐约感觉有什么不对,我的服务器是termux,之前只有使用ssh登陆termux上的记录,所以这个公钥是其他服务器上粘贴过来的,于是删除这个公钥并重新创建了一个秘钥对,解决了问题,命令如下

~/jiangcheng-pages $
~/jiangcheng-pages $
~/jiangcheng-pages $ ls ~/.ssh/
authorized_keys  id_rsa.pub  known_hosts
~/jiangcheng-pages $ rm -f ~/.ssh/id_rsa.pub
~/jiangcheng-pages $
~/jiangcheng-pages $
~/jiangcheng-pages $
~/jiangcheng-pages $ ssh-keygen -t rsa -C "jiangcheng1806@qq.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/data/data/com.termux/files/home/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /data/data/com.termux/files/home/.ssh/id_rsa
Your public key has been saved in /data/data/com.termux/files/home/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:6plhjlQPdfEr/uxuMWKwFBjcQ288FbpOYAOI3j+gua0 jiangcheng1806@qq.com
The key's randomart image is:
+---[RSA 3072]----+
|   . oo=. . o.   |
|  . . o.+o =     |
| . .    =oB .    |
|  . o  oo= o .   |
|   o oo.So+ .    |
|  o  .o+.+o.o    |
|   o. +...o. o   |
|  ...= +   o.    |
|  E.. =    +=    |
+----[SHA256]-----+
~/jiangcheng-pages $
~/jiangcheng-pages $
~/jiangcheng-pages $

创建好本地的id_rsa.pub之后配置到github个人ssh key配置,之后执行命令,问题解决

~/jiangcheng-pages $ hexo d -g
INFO  Validating config
INFO  Start processing
WARN  ===============================================================
WARN  ========================= ATTENTION! ==========================
WARN  ===============================================================
WARN   NexT repository is moving here: https://github.com/theme-next
WARN  ===============================================================
WARN   It's rebase to v6.0.0 and future maintenance will resume there
WARN  ===============================================================
INFO  Files loaded in 815 ms
INFO  0 files generated in 56 ms
INFO  Deploying: git
INFO  Clearing .deploy_git folder...
INFO  Copying files from public folder...
INFO  Copying files from extend dirs...
On branch master
nothing to commit, working tree clean
Enumerating objects: 192, done.
Counting objects: 100% (192/192), done.
Delta compression using up to 8 threads
Compressing objects: 100% (174/174), done.
Writing objects: 100% (192/192), 1.88 MiB | 1.14 MiB/s, done.
Total 192 (delta 13), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (13/13), done.
To github.com:jiangcheng1806/sky-jiangcheng.github.io.git
 * [new branch]      HEAD -> master
branch 'master' set up to track 'git@github.com:jiangcheng1806/sky-jiangcheng.github.io.git/master'.
INFO  Deploy done: git
~/jiangcheng-pages $
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值