hexo上传报错Spawn failed
报错
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html Error: Spawn failed at ChildProcess.<anonymous> (D:\myblog\node_modules\hexo-deployer-git\node_modules\hexo-util\lib\spawn.js:51:21) at ChildProcess.emit (node:events:519:28) at cp.emit (D:\myblog\node_modules\cross-spawn\lib\enoent.js:34:29) at ChildProcess._handle.onexit (node:internal/child_process:293:12)
解决过程
通过命令ssh -T git@github.com不能连通github。原因是GitHub 22 端口被占用,所以需要改用 443 端口连接。
我这里重新生成了一遍ssh秘钥,也记录下来。
打开Git Bash 输出
ssh-keygen -t rsa -C "你的邮箱地址"一直回车有yes输入yes打开
C:\Users\<用户名>\.ssh目录下的id_rsa.pub,复制里面的全部内容打开Github,点击设置

下滑找到
SSH and GPG keys,点击New SSH key
Title随便输,将复制的内容粘贴到Key然后点击
Add SSH key
改用443端口连接
打开
C:\Users\<用户名>\.ssh创建文件config,不要带后缀输入内容保存
1
2
3
4
5
6Host github.com
HostName ssh.github.com
User git
Port 443
PreferredAuthentications publickey
IdentityFile C:\Users\<用户名>\.ssh\id_rsa再次打开Git Bash输出
ssh -T git@github.com测试1
Hi 你的名字! You've successfully authenticated, but GitHub does not provide shell access.
然后就可以继续愉快的hexo clean ==> hexo g ==> hexo d了





