稳妥更新

博客根目录下执行npm outdated,查看所有过时的版本,我的过时信息如下:

1
2
3
4
5
6
Package               Current   Wanted   Latest  Location                           Depended by
hexo 6.3.0 6.3.0 7.1.1 node_modules/hexo hexo-gitee-blog-management
hexo-deployer-git 3.0.0 3.0.0 4.0.0 node_modules/hexo-deployer-git hexo-gitee-blog-management
hexo-renderer-marked 6.0.0 6.3.0 6.3.0 node_modules/hexo-renderer-marked hexo-gitee-blog-management
hexo-theme-landscape 0.0.3 0.0.3 1.0.0 node_modules/hexo-theme-landscape hexo-gitee-blog-management
yarn 1.22.19 1.22.22 1.22.22 node_modules/yarn hexo-gitee-blog-management

执行npm update可更新所有过时的版本

风险最新

以下指令均在博客根目录下操作

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 查看当前版本,判断是否需要升级
hexo version
# 全局升级hexo-cli
npm i hexo-cli -g
# 再次查看版本,看hexo-cli是否升级成功
hexo version
# 安装npm-check,若已安装可以跳过
npm install -g npm-check
# 检查系统插件是否需要升级
npm-check
# 安装npm-upgrade,若已安装可以跳过
npm install -g npm-upgrade
# 更新package.json
npm-upgrade
# 更新全局插件
npm update -g
# 更新系统插件
npm update --save
# 再次查看版本,判断是否升级成功
hexo version

最终版本信息如下:

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
28
29
30
31
32
33
34
35
36
37
38
INFO  Validating config
INFO
===================================================================
##### # # ##### ##### ###### ##### ###### # # #
# # # # # # # # # # # # #
##### # # # # ##### # # ##### # #
# # # # # # # ##### # # #
# # # # # # # # # # # #
##### #### # # ###### # # # ###### #
4.13.0
===================================================================
hexo: 7.1.1
hexo-cli: 4.3.1
os: win32 10.0.22631
node: 20.11.0
acorn: 8.11.2
ada: 2.7.4
ares: 1.20.1
base64: 0.5.1
brotli: 1.0.9
cjs_module_lexer: 1.2.2
cldr: 43.1
icu: 73.2
llhttp: 8.1.1
modules: 115
napi: 9
nghttp2: 1.58.0
nghttp3: 0.7.0
ngtcp2: 0.8.1
openssl: 3.0.12+quic
simdutf: 4.0.4
tz: 2023c
undici: 5.27.2
unicode: 15.0
uv: 1.46.0
uvwasi: 0.0.19
v8: 11.3.244.8-node.17
zlib: 1.2.13.1-motley-5daffc7

参考文档

Hexo 和Next主题升级

Hexo版本升级指南