GitHub 搭建博客,出现 hexo g -d 报错

  想搭建一个个人博客,但是在将博客推送到Github上的时候在git bash 下运行hexo g -d命令出现错误:

  错误如下:

 fatal: HttpRequestException encountered.
   ▒▒▒▒▒▒▒▒ʱ▒▒▒▒
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': No error
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/do                                                                     
cs/troubleshooting.html
Error: fatal: HttpRequestException encountered.
           ʱ   
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': No error
    at ChildProcess.<anonymous> (F:\blog\huahua462.github.io\node_modules\hexo-u                                                                    
 til\lib\spawn.js:37:17)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at ChildProcess.cp.emit (F:\blog\huahua462.github.io\node_modules\cross-spaw                                                                     
n\lib\enoent.js:40:29)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) 
 
   解决方案:
  首先在“你GitHub注册用户名.github.io”本地文件夹下有一个名为“_config.yml”的配置文件,这个称为站点配置文件,使用NotePad++打开并拉到文件最后,将:
    
deploy:
  type: git 
  repo: https://github.com/你GitHub注册用户名/你GitHub注册用户名.github.io.git 
  branch: master

  改为:

deploy:
  type: git 
  repo: git@github.com:你GitHub注册用户名/你GitHub注册用户名.github.io.git 
  branch: master

  即可;亲测有效

转载于:https://www.cnblogs.com/huahua12/p/8491805.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值