Hexo博客重置

2025年07月25日星期五, 今天是离开北师大后第一次更新博客,原因是一直没有时间来重新配置系统。在新电脑上启用diary.sh脚本时,需要提前配置好hexo, 因为直接clone博客仓库后,使用hexo shexo g均报错:

报错
1
2
3
4
5
Error: Cannot find module './db.json'
Require stack:
- /home/feng/.DY_SCE/fungzhenhua.github.io/node_modules/mime-db/index.js
- /home/feng/.DY_SCE/fungzhenhua.github.io/node_modules/compressible/index.js
- /home/feng/.DY_SCE/fungzhenhua.github.io/node_modules/compression/index.js

解决方法为:使用yarn对应的命令清理缓存和重装.

1
2
3
yarn cache clean
rm -rf node_modules
yarn install

之后使用hexo g, 重新生成仓库后问题解决。