node.js - hexo 博客搭建时出现的问题

 love灬贪恋猫 发布于 2022-10-31 00:37

hexo d时出现下面的问题:
$ hexo d
INFO Deploying: git
INFO Clearing .deploy_git folder...
INFO Copying files from public folder...
fatal: bad config file line 1 in .git/config
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troublesh...
Error: fatal: bad config file line 1 in .git/config

at ChildProcess. (G:\Blog\node_modules\hexo-util\lib\spawn.js:37:17)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at ChildProcess.cp.emit (G:\Blog\node_modules\cross-spawn\lib\enoent.js:40:29)
at maybeClose (internal/child_process.js:886:16)
at Socket. (internal/child_process.js:342:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:501:12)

FATAL fatal: bad config file line 1 in .git/config

Error: fatal: bad config file line 1 in .git/config

at ChildProcess. (G:\Blog\node_modules\hexo-util\lib\spawn.js:37:17)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at ChildProcess.cp.emit (G:\Blog\node_modules\cross-spawn\lib\enoent.js:40:29)
at maybeClose (internal/child_process.js:886:16)
at Socket. (internal/child_process.js:342:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:501:12)


找了好久 没找出哪里出了问题
1 个回答
  • 如果你要往github上传请先安装git
    然后配置

    $ git config --global user.name "Your Name"
    $ git config --global user.email "email@example.com"

    安装必要插件
    npm install hexo-deployer-git --save

    在_config.yml添加一下配置
    deploy:

     type: git
     repo: https://github.com/yourname/yourname.github.io.git
     branch: master
    
    
    2022-10-31 22:12 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有