hexo-update

  1. 1. hexo及hexo模块升级指北

hexo及hexo模块升级指北

首先进入blog目录,看看有哪些需要升级的

1
2
3
4
5
6
7
8
#npm outdated
Package Current Wanted Latest Location
hexo 5.0.0 5.2.0 5.2.0 hexo-site
hexo-generator-feed 3.0.0 2.2.0 3.0.0 hexo-site
hexo-generator-sitemap MISSING 2.1.0 2.1.0 hexo-site
hexo-renderer-marked 3.0.0 3.3.0 3.3.0 hexo-site
hexo-renderer-stylus 1.1.0 1.1.0 2.0.1 hexo-site
hexo-server 1.0.0 1.0.0 2.0.0 hexo-site

简单修改一下 package.json 文件:

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
{
"name": "hexo-site",
"version": "0.0.0",
"private": true,
"scripts": {
"build": "hexo generate",
"clean": "hexo clean",
"deploy": "hexo deploy",
"server": "hexo server"
},
"hexo": {
"version": "5.2.0"
},
"dependencies": {
"hexo": "^5.2.0",
"hexo-generator-archive": "^1.0.0",
"hexo-generator-category": "^1.0.0",
"hexo-generator-feed": "^2.2.0",
"hexo-generator-index-pin-top": "^0.2.2",
"hexo-generator-sitemap": "^2.1.0",
"hexo-generator-tag": "^1.0.0",
"hexo-renderer-ejs": "^1.0.0",
"hexo-renderer-marked": "^3.3.0",
"hexo-renderer-stylus": "^1.1.0",
"hexo-server": "^1.0.0"
}
}

都修改好了以后,就 npm 更新一下:

1
npm install --save

搞掂,运行 Hexo 看看效果:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#hexo version
INFO Validating config
hexo: 5.2.0
hexo-cli: 4.2.0
os: Windows_NT 10.0.19041 win32 x64
node: 12.18.3
v8: 7.8.279.23-node.39
uv: 1.38.0
zlib: 1.2.11
brotli: 1.0.7
ares: 1.16.0
modules: 72
nghttp2: 1.41.0
napi: 6
llhttp: 2.0.4
http_parser: 2.9.3
openssl: 1.1.1g
cldr: 37.0
icu: 67.1
tz: 2019c
unicode: 13.0