创建博客hexo init时报错Github被墙的解决方法

当hexo init时,报错:

INFO  Cloning hexo-starter https://github.com/hexojs/hexo-starter.git
error: RPC failed; curl 28 OpenSSL SSL_read: Connection was reset, errno 10054
fatal: expected flush after ref listing
WARN  git clone failed. Copying data instead
FATAL {
  err: [Error: ENOENT: no such file or directory, scandir 'C:\Users\Jupiter\AppData\Roaming\npm\node_modules\hexo-cli\assets'] {
    errno: -4058,
    code: 'ENOENT',
    syscall: 'scandir',
    path: 'C:\\Users\\Jupiter\\AppData\\Roaming\\npm\\node_modules\\hexo-cli\\assets'
  }
} Something's wrong. Maybe you can find the solution here: %s http://hexo.io/docs/troubleshooting.html

说明Github被墙了,一般给出的解决方案都是挂梯子,但是如果没有梯子呢?
实际上,可以使用Gitee(码云)来替代Github,将文件:

C:\Users\Jupiter\AppData\Roaming\npm\node_modules\hexo-cli\lib\console\init.js

中的

const GIT_REPO_URL = 'https://github.com/hexojs/hexo-starter.git';

改为:

const GIT_REPO_URL = 'https://gitee.com/hexojs/hexo-starter.git';

就可以了,亲测有效。

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 7
    评论
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值