解决hexo报错spwan failed

本文最后更新于:2022年7月2日 下午

Hexo部署出现错误Error:Spawn failed解决方式

Hexo部署出现以下错误Error:Spawn failed解决方式

1
2
3
4
5
6
7
8
9
FATAL {
err: Error: Spawn failed
at ChildProcess.<anonymous> (C:\Users\myosotis\Desktop\Hexo_blog\node_modules\hexo-util\lib\spawn.js:51:21)
at ChildProcess.emit (events.js:315:20)
at ChildProcess.cp.emit (C:\Users\myosotis\Desktop\Hexo_blog\node_modules\cross-spawn\lib\enoent.js:34:29)
at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) {
code: 128
}
} Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html

从网上找了几个方法:

方法一

1
2
3
4
5
6
7
8
9
10
##进入站点根目录

##删除git提交内容文件夹
rm -rf .deploy_git/

##执行
git config --global core.autocrlf false

##最后
hexo clean && hexo g && hexo d

没能成功,仍然报错。

方法二

修改_config.yml文件,将配置地址http方式切换成ssh方式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
##进入站点根目录

##删除git提交内容文件夹
vim _config.yml

##修改
deploy:

type: git

repository: https://github.com/Uninfo/blog.github.io.git
-> git@github.com:Uninfo/blog.github.io.git

branch: master

##最后
hexo clean && hexo g && hexo d

不习惯用vim,直接用编辑器打开_config.yml文件,将配置地址的http方式换成ssh方式。

解决,成功部署。

方法三

强制上传,没试过,网上说不建议

1
2
3
4
5
6
7
##进入站点根目录

##进入depoly文件夹
cd .deploy_git/

##强制推送
git push -f

解决hexo报错spwan failed
http://example.com/2022/05/26/failed解决方式/
作者
dogNew
发布于
2022年5月26日
许可协议