Hexo版本升级
先升级Node.js到最新版
这里推荐使用nvm
安装最新版node
升级Hexo
1 | # 安装hexo-cli命令行工具 |
可能出现的异常
- npm install -g hexo-cli此情况是之前配置的
1
2
3
4
5
6
7$ npm install -g hexo-cli
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/hexo-cli failed, reason: certificate has expired
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/xdj/.npm/_logs/2024-04-19T01_08_00_873Z-debug.lognpm
源证书过期,需要更换新的源。npm config set registry https://registry.npmmirror.com
- npm-upgrade
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27$ npm-upgrade
Checking for outdated production, optional, development, peer and bundled dependencies for "/Users/xdj/Documents/Hexo/package.json"...
[====================] 13/13 100%
New versions of active modules available:
hexo ^4.2.0 → ^7.2.0
hexo-cli ^3.1.0 → ^4.3.2
hexo-deployer-git ^2.1.0 → ^4.0.0
hexo-generator-archive ^1.0.0 → ^2.0.0
hexo-generator-category ^1.0.0 → ^2.0.0
hexo-generator-index ^1.0.0 → ^3.0.0
hexo-generator-searchdb ^1.2.0 → ^1.4.1
hexo-generator-tag ^1.0.0 → ^2.0.0
hexo-renderer-ejs ^1.0.0 → ^2.0.0
hexo-renderer-marked ^2.0.0 → ^6.3.0
hexo-renderer-stylus ^1.1.0 → ^3.0.1
hexo-server ^1.0.0 → ^3.0.0
? Update "hexo" in package.json from ^4.2.0 to ^7.2.0? Yes
? Update "hexo-cli" in package.json from ^3.1.0 to ^4.3.2? (Use arrow keys)
❯ Yes
No
Show changelog
Ignore
Finish update process
一路yes
即可