hexo d部署报错spawn failed的解决方案

许多小伙伴第一次接触Hexo框架编写博客时,hexo d部署的时候报错导致无法推送到github,是一个非常常见的问题。
下面是我的解决方案,希望对大家有帮助。

问题描述:

出现错误:error:spawn failed…

解决方案(一)

使用科学上网工具

解决方案(二)

  1. 删除博客根目录中的.deploy_git 文件
  2. 在博客根目录git bash输入
    1
    git config --global core.autocrlf false
    把git加入系统环境变量
  3. 重新执行
    1
    2
    3
    hexo clean 
    hexo g
    hexo d

    解决方案(三)

  4. 在博客根目录git bash输入
    1
    2
    npm un hexo-deployer-git
    npm i hexojs/hexo-deployer-git
    可能会有些慢,等待一些时间即可。
  5. 重新执行
    1
    2
    3
    hexo clean 
    hexo g
    hexo d