Hexo 升级至7.1.1

当前Hexo最新release版本 Hexo7.1.1

在当前Hexo路径下执行:

1
npm i hexo@7.1.1

由于之前是3.8.1 直接升级到7.1.1版本问题较多

新建一个目录 执行hexo init 查看package.json中的依赖

将旧版本项目中的依赖版本修改为最新的

报错请按错误提示升级node 版本,可以使用nvm进行多版本管理

1
hexo server 

hexo-q1

乱码问题是由于hexo 移除了hexo-renderer-swig https://github.com/hexojs/hexo-renderer-swig?tab=readme-ov-file

1
$ npm install hexo-renderer-swig --save  #可以解决

但是既然已经废弃了,我们就迁移到 nunjucks

跟着文档一步一步走吧, Ready Go!

But…..

I found hexo-renderer-nunjucks had been archived…

我们暂且先用,让他能跑起来. 后续迁移到 hugo

1
2
3
4
5
6
7
8
9
10
npm install hexo-renderer-nunjucks --save
hexo clean
hexo generate
hexo deploy
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
Error: Spawn failed
at ChildProcess.<anonymous> (/Users/hujiawei/Dropbox/blog/node_modules/hexo-deployer-git/node_modules/hexo-util/lib/spawn.js:51:21)
at ChildProcess.emit (node:events:514:28)
at ChildProcess._handle.onexit (node:internal/child_process:291:12)

  1. 删除.deploy_git文件夹;

  2. 输入git config --global core.autocrlf false

  3. 然后,依次执行:
    hexo clean
    hexo g
    hexo d

  4. image-20240317001819875

  5. image-20240317002159619

  6. image-20240317002344971

    修改后重新执行

    hexo clean

    hexo g

    hexo d

至此升级完成✅