---
title: "Troubleshooting a Hexo Upgrade to V5"
description: "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."
author: "kidneyweakx"
published: 2021-03-18T00:00:00.000Z
updated: 2026-06-02T17:26:19.841Z
lang: en
tags: ["程式筆記", "Javascript", "hexo"]
canonical: https://kidneyweakx.com/blog/21log-0318-hexov5?lang=en
alternate_zh_tw: https://kidneyweakx.com/blog/21log-0318-hexov5.md
alternate_ja: https://kidneyweakx.com/blog/21log-0318-hexov5.md?lang=ja
---

# 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](https://github.com/coneycode/hexo-git-backup/issues/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']);
```
