0%

Hexo Next 升级

Hexo & Next 升级

github 博客的源码库惊现风险漏洞,去官网看了下现行版本,着手更新一版

Untitled-1-20200228141917.png

Hexo

  • 使用npm 命令查看已经过期的安装包
    1
    npm outdated
  • 安装npm升级插件
    1
    npm install -g npm-check-updates
  • 查看最新的版本命令
    1
    ncu
  • 升级低版本的npm包文件
    1
    ncu -u
  • 更新生产依赖包
    1
    npm install --save
  • 查看依赖版本已更新了
    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
    [root@VM-202 /home/hoke/Documents/blog]# git diff package.json
    diff --git a/package.json b/package.json
    index a473667..54ad330 100644
    --- a/package.json
    +++ b/package.json
    @@ -9,11 +9,11 @@
    "server": "hexo server"
    },
    "hexo": {
    - "version": "4.0.0"
    + "version": "4.2.0"
    },
    "dependencies": {
    - "hexo": "^4.0.0",
    - "hexo-deployer-git": "^2.0.0",
    + "hexo": "^4.2.0",
    + "hexo-deployer-git": "^2.1.0",
    "hexo-generator-archive": "^1.0.0",
    "hexo-generator-baidu-sitemap": "^0.1.6",
    "hexo-generator-category": "^1.0.0",
    @@ -21,11 +21,11 @@
    "hexo-generator-searchdb": "^1.2.0",
    "hexo-generator-sitemap": "^2.0.0",
    "hexo-generator-tag": "^1.0.0",
    - "hexo-related-popular-posts": "^3.0.6",
    + "hexo-related-popular-posts": "^4.0.0",
    "hexo-renderer-ejs": "^1.0.0",
    "hexo-renderer-marked": "^2.0.0",
    "hexo-renderer-stylus": "^1.1.0",
    "hexo-server": "^1.0.0",
    - "hexo-symbols-count-time": "^0.6.3"
    + "hexo-symbols-count-time": "^0.7.0"
    }
    -}
    +}
    \ No newline at end of file
    升级完成后记得 commit 至仓库

Next

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
[root@VM-202 /home/hoke/Documents/blog/themes/hexo-theme-next]# git remote -v
next https://github.com/theme-next/hexo-theme-next.git (fetch)
next https://github.com/theme-next/hexo-theme-next.git (push)
origin git@github.com:hoke58/hexo-theme-next.git (fetch)
origin git@github.com:hoke58/hexo-theme-next.git (push)
[root@VM-202 /home/hoke/Documents/blog/themes/hexo-theme-next]# git pull next
remote: Enumerating objects: 354, done.
remote: Counting objects: 100% (354/354), done.
remote: Compressing objects: 100% (36/36), done.
remote: Total 715 (delta 322), reused 327 (delta 318), pack-reused 361
Receiving objects: 100% (715/715), 124.12 KiB | 19.00 KiB/s, done.
Resolving deltas: 100% (462/462), completed with 147 local objects.
From https://github.com/theme-next/hexo-theme-next
* [new branch] cdn -> next/cdn
* [new branch] funding -> next/funding
* [new branch] i18n -> next/i18n
982d243..97230d1 master -> next/master
* [new tag] v7.6.0 -> v7.6.0
* [new tag] v7.7.0 -> v7.7.0
* [new tag] v7.7.1 -> v7.7.1
You asked to pull from the remote 'next', but did not specify
a branch. Because this is not the default configured remote
for your current branch, you must specify a branch on the command line.

有冲突的文件修改一下,然后 merge 至自己仓库

坚持原创技术分享,您的支持将鼓励我继续创作!