部署hexo-blog-encrypt中遇到的一些问题

安装hexo-blog-encrypt插件后发现执行hexo clean && hexo g报错错误如下
TypeError: data.tags.forEach is not a function

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
TypeError: data.tags.forEach is not a function
at Hexo.<anonymous> (/vercel/path0/node_modules/hexo-blog-encrypt/index.js:53:15)
at Hexo.tryCatcher (/vercel/path0/node_modules/bluebird/js/release/util.js:16:23)
at Hexo.<anonymous> (/vercel/path0/node_modules/bluebird/js/release/method.js:15:34)
at /vercel/path0/node_modules/hexo/dist/extend/filter.js:58:67
at tryCatcher (/vercel/path0/node_modules/bluebird/js/release/util.js:16:23)
at Object.gotValue (/vercel/path0/node_modules/bluebird/js/release/reduce.js:166:18)
at Object.gotAccum (/vercel/path0/node_modules/bluebird/js/release/reduce.js:155:25)
at Object.tryCatcher (/vercel/path0/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/vercel/path0/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/vercel/path0/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/vercel/path0/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/vercel/path0/node_modules/bluebird/js/release/promise.js:729:18)
at _drainQueueStep (/vercel/path0/node_modules/bluebird/js/release/async.js:93:12)
at _drainQueue (/vercel/path0/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/vercel/path0/node_modules/bluebird/js/release/async.js:102:5)
at Async.drainQueues [as _onImmediate] (/vercel/path0/node_modules/bluebird/js/release/async.js:15:14)

解决方案

检查各篇文章中是否存在非数组形式的标签,文章分类虽然不会对页面生成产生较大影响,但是通过日志发现会对关键词的生产造成部分错误。
形如

1
2
tags:
- xxx

修改为

1
tags: [xxx]

相关链接

D0n9X1n/hexo-blog-encrypt(github.com)
安装插件后hexo g报错 TypeError: data.tags.forEach is not a function(github.com)