问题出现:

1
2
3
4
5
6
err: Error: Spawn failed
at ChildProcess.<anonymous> (D:\workplace\blog\node_modules\hexo-util\lib\spawn.js:51:21)
at ChildProcess.emit (events.js:376:20)
at ChildProcess.cp.emit (D:\workplace\blog\node_modules\cross-spawn\lib\enoent.js:34:29)
at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) {
code: 128

常规解决办法:

解决方法一:

1
2
3
# 第一个就是你的邮箱,第二个就是你的用户名
git config --global user.email "2673065011@qq.com"
git config --global user.name "210173313"

解决方法二:

1
2
3
4
5
6
# 删除.deploy_git文件夹,输入:
git config --global core.autocrlf false
# 然后,依次执行:
hexo clean
hexo g
hexo d

解决方法三:

1
2
3
4
5
6
7
8
# 打开_config.yml配置文件,修改以下内容

deploy:
type: 'git'
repo: https://github.com/yourname/yourname.github.io.git
branch: master
# 其中的repo修改为
repo: git@github.com:yourname/yourname.github.io.git

试了一下以上常规方法,并没有解决问题,最后的解决办法是重新创建git仓库并连接,然后成功部署。