在执行 hexo d
操作将文章上传到GitHub时报错
Please make sure you have the correct access rights
and the repository exists.
FATAL Something’s wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
Error: Spawn failed
at ChildProcess. (E:\Gzz\blog-github\node_modules\hexo-util\lib\spawn.js:51:21)
at ChildProcess.emit (node:events:520:28)
at ChildProcess.cp.emit (E:\Gzz\blog-github\node_modules\cross-spawn\lib\enoent.js:34:29)
at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
这个错误是由于 没有正确连接到 GitHub
解决方法
- 找到 .deploy_git下的 config 文件 打开并加入
- [user]
email = 你的github邮箱
name = 你的GitHub名字
3. - 保存退出
- 找到 _config.yml 文件并编辑
- deploy:
type: git
repo: 这里设置的是你仓库的 https 地址
branch: master
保存并退出后 执行 hexo d
成功!