当前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 移除了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 | npm install hexo-renderer-nunjucks --save |
删除
.deploy_git
文件夹;输入
git config --global core.autocrlf false
然后,依次执行:
hexo clean
hexo g
hexo d
修改后重新执行
hexo clean
hexo g
hexo d
至此升级完成✅