1. 程式人生 > 其它 >Hexo部署出現錯誤err: Error: Spawn failed解決方式

Hexo部署出現錯誤err: Error: Spawn failed解決方式

Hexo部署過程中可能會出現錯誤

fatal: unable to access 'https://github.com/a956551943/a956551943.github.io/': Encountered end of file
FATAL {
  err: Error: Spawn failed
      at ChildProcess.<anonymous> (/usr/local/src/hexo/hanyubolg/node_modules/hexo-util/lib/spawn.js:51:21)
      at ChildProcess.emit (events.js:376:20)
      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 ———————————————— 版權宣告:本文為CSDN博主「wei-xiansen」的原創文章,遵循CC 4.0 BY-SA版權協議,轉載請附上原文出處連結及本宣告。 原文連結:https://blog.csdn.net/weixin_41256398/article/details/117994899

解決方式一:

##進入站點根目錄
cd /usr/local/src/hexo/hanyubolg/

##刪除git提交內容資料夾
rm -rf .deploy_git/

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

##最後
hexo clean && hexo g && hexo d
————————————————
版權宣告:本文為CSDN博主「wei-xiansen」的原創文章,遵循CC 4.0 BY-SA版權協議,轉載請附上原文出處連結及本宣告。
原文連結:https://blog.csdn.net/weixin_41256398/article/details/117994899

解決方式二:有可能是你的git repo配置地址不正確,可以將http方式變更為ssh方式

##進入站點根目錄
cd /usr/local/src/hexo/hanyubolg/

##刪除git提交內容資料夾
vim _config.yml

##修改
deploy:

type: git

repo: https://github.com/yourname/yourname.github.io.git -> [email protected]:a956551943/weixiaohui.github.io.git

branch: master

##最後
hexo clean && hexo g && hexo d
————————————————
版權宣告:本文為CSDN博主「wei-xiansen」的原創文章,遵循CC 4.0 BY-SA版權協議,轉載請附上原文出處連結及本宣告。
原文連結:https://blog.csdn.net/weixin_41256398/article/details/117994899

解決方式三:不建議

##進入站點根目錄
cd /usr/local/src/hexo/hanyubolg/

##進入depoly資料夾
cd .deploy_git/

##強制推送
git push -f
願君前程似錦,歸來仍是少年