[Hexo] Hexo Frequently Asked Questions (FAQs)

Hexo FAQs

Hexo Deploy

Suddenly hexo deploy encountered a strange problem. During this period of time, the deployment-related code has not been modified.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$ hexo deploy
To github.com:CloudoLife/col-hexo-CloudoLife.github.io.git
! [remote rejected] HEAD -> main (bad ref)
error: failed to push some refs to 'github.com:CloudoLife/col-hexo-CloudoLife.github.io.git'
FATAL {
err: Error: Spawn failed
at ChildProcess.<anonymous> (/home/runner/work/col-hexo-CloudoLife/col-hexo-CloudoLife/node_modules/hexo-util/lib/spawn.js:51:21)
at ChildProcess.emit (events.js:315:20)
at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) {
code: 1
}
} Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] deploy: `hexo deploy --config _config.yml,_overrideconfig.yml`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

It may be caused by unsuccessful branch push, change deploy to another branch(such from main to master) to resolve it.

1
2
3
4
5
deploy:
type: git
repository: [email protected]:CloudoLife/col-hexo-CloudoLife.github.io.git
- branch: main
+ branch: master

Remember to change the branch with GitHub Pages - https://github.com/CloudoLife/col-hexo-CloudoLife.github.io/settings/pages

References

[1] GitHub Pages | Hexo - https://hexo.io/docs/github-pages