next升级8遇坑

环境

本地 md文件 + coding 持续集成 + github 持续集成 + vercel

报错

启动报错

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FATAL Cannot find module '../../package.json'
Require stack:
- D:\wwwroot\hexoT\themes\next-8.12.1\scripts\events\index.js
Error: Cannot find module '../../package.json'
Require stack:
- D:\wwwroot\hexoT\themes\next-8.12.1\scripts\events\index.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (D:\wwwroot\hexoT\node_modules\hexo\lib\hexo\index.js:280:23)
at Hexo.<anonymous> (D:\wwwroot\hexoT\themes\next-8.12.1\scripts\events\index.js:20:23)
at Hexo.emit (node:events:390:28)
at D:\wwwroot\hexoT\node_modules\hexo\lib\hexo\index.js:234:12
at tryCatcher (D:\wwwroot\hexoT\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (D:\wwwroot\hexoT\node_modules\bluebird\js\release\promise.js:547:31)
at Promise._settlePromise (D:\wwwroot\hexoT\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (D:\wwwroot\hexoT\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (D:\wwwroot\hexoT\node_modules\bluebird\js\release\promise.js:729:18)
at _drainQueueStep (D:\wwwroot\hexoT\node_modules\bluebird\js\release\async.js:93:12)
at _drainQueue (D:\wwwroot\hexoT\node_modules\bluebird\js\release\async.js:86:9)
at Async._drainQueues (D:\wwwroot\hexoT\node_modules\bluebird\js\release\async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (D:\wwwroot\hexoT\node_modules\bluebird\js\release\async.js:15:14)
at processImmediate (node:internal/timers:464:21)

没有找到相关的解决文档,可能是hexo-cli 版本有关

解决

更新hexo-cli 6和node.js 18解决问题

图床问题

使用hexo-asset-image插件,图床链接多了一个斜杠,coding 无法识别直接跳转404

https://nobige.coding.net/p/nobige/d/public/git/lfs/master/post/20220727-Centos_pei_zhi_an_zhuang_Tomcat//mauro-lima-oUyEx8C960Q-unsplash.jpg

解决

更新 https://github.com/JackCh3n/hexo-asset-image 插件即可

本地搜索

新版本,本地搜索不支持CDN

解决

取消CDN