QUEST LOG · March 18, 2021· UPDATED June 2, 2026

Troubleshooting a Hexo Upgrade to V5

I happened to reinstall my computer, and this blog was lying on my D: drive waiting for me to move it into a fresh environment, so I happily upgraded it.

bash
hexo: 5.4.0
hexo-cli: 4.2.0
os: Windows 10 20H2
node: 14.16.0

# Updating hexo to v5.0

Updating hexo to V5 is pretty easy:

bash
npm install -g npm-upgrade
npm-upgrade
npm i

and it updates automatically. But major version upgrades usually come with a few small problems, and sure enough it gave me a few warnings.

# Error after updating

bash
Deprecated config detected: "external_link" with a Boolean value is deprecated. See https://hexo.io/docs/configuration for more details.

# Solution

Update that part of _config.yml to the new format. The original external_link only had a true option; after the update you can decide whether to open links in a new tab.

yaml
# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
# 修改這個部分
external_link:
  enable: true # Open external links in new tab
  field: site # Apply to the whole site
  exclude: ''
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
highlight:
  enable: true
  line_number: true
  auto_detect: false
  tab_replace: ''
  wrap: true
  hljs: false
prismjs:
  enable: false
  preprocess: true
  line_number: true
  tab_replace: ''

# hexo-git-backup push error

This update also caused big problems with the hexo-git-backup module I use.

bash
error: src refspec master does not match any
error: failed to push some refs to 'github'

Someone answered this in issue#40 ↗.

The fix is roughly this: find the line above in node_module/hexo-git-backup and change master to backup. My own branch is backup, after all, so it couldn't find master.

jsx
// 找到這行
// commands.push(['push', '-u', t, 'master:' + repo[t].branch, '--force']);
// 更換成這行
commands.push(['push', '-u', t, 'backup:' + repo[t].branch, '--force']);

Apps I ship

Free on iOS and Android.

Solid(ar)ity

Solid(ar)ity

A privacy-first identity wallet: zero-knowledge proofs and signed cards swapped face to face, no central server.