使用HEXO搭建个人博客时遇到的问题日志 PART.1

2023-11-17

我都没想到光连建站都能遇到这么多问题…

1.解决 Failed to connect to github.com port 443:connection timed out

  • 当使用hexo d的时候,一直连接超时。大概率应该是vpn导致的
方案汇总:
  • 换一个网络,或等一段时间可能会好

  • 关闭vpn

  • 执行git config --global --unset http.proxy

  • 进入hexo文件夹里的_config.yml文件

    repo: https://github.com/xxx/xxx.io.git更改为ssh地址repo: git@github.com:xxx/xxx.github.io.git

    一定要注意yml文件的格式问题(:后有空格)

  • 这个网站,搜出github.com的ip地址后记下来

image-20220113113517292

​ 执行sudo vi /etc/hosts,按a进行插入,插入一条140.82.114.4 github.com(具体ip地址根据你当时的查询结果而定),然后按esc再按两次大写的Z退出。这时候再执行hexo d应该就不会出现超时的问题了,但你可能会发现执行几次hexo d之后超时问题又会出现,这个时候你就再sudo vi /etc/hosts重新查询一下github的ip地址然后修改一下,如果查出来和之前的插入的是相同的就直接吧插入的删掉,再执行hexo d,如果还是不行就再插入,多试几次就好了。

2.解决remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.

请看这篇博客

3.解决remote: Permission to xxx/xxx.github.io.git denied to xxx.

fatal: unable to access ‘https://github.com/reinhart-l/reinhart-l.github.io.git/’: The requested URL returned error: 403

  • hexo d成功后让你输入用户名和密码,可能会出现以上报错

    注意这里输入的密码是github的token token如何获取请看[这篇博客][https://blog.csdn.net/weixin_41010198/article/details/119698015]

方案汇总:
  • 若报错形如remote: Permission to XXXA/xxxx.git denied to XXXB

    可能是电脑上有多个ssh密钥和用户导致的,详细解决可以看这篇博客

  • 若用户名和密钥对应,去github检查一下token的repo权限有没有开。

    image-20220113115241999

4.解决hexo搭建Github博客上传后,网页显示404问题

  • 进入hexo文件夹里的_config.yml文件

    repo: git@github.com:xxx/xxx.github.io.git更改为https地址

    repo: https://github.com/xxx/xxx.github.io.git

  • 其他解决方案参考这篇博客

5.解决Error in the HTTP2 framing layer

执行
git config --global --unset http.proxy
git config --global --unset https.proxy

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

使用HEXO搭建个人博客时遇到的问题日志 PART.1 的相关文章