加载中...
avatar

Hexo 生成静态文件时报错汇总

问题1.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
tony@DESKTOP-DLE9QF3 MINGW64 /d/Hexo
$ hexo g

INFO Start processing
ERROR Process failed: _data/link.yml
YAMLException: bad indentation of a mapping entry at line 15, column 2:
class2:
^
at generateError (D:\Hexo\node_modules\js-yaml\lib\js-yaml\loader.js:167:10)
at throwError (D:\Hexo\node_modules\js-yaml\lib\js-yaml\loader.js:173:9)
at readBlockMapping (D:\Hexo\node_modules\js-yaml\lib\js-yaml\loader.js:1107:7)
at composeNode (D:\Hexo\node_modules\js-yaml\lib\js-yaml\loader.js:1359:12)
at readDocument (D:\Hexo\node_modules\js-yaml\lib\js-yaml\loader.js:1519:3)
at loadDocuments (D:\Hexo\node_modules\js-yaml\lib\js-yaml\loader.js:1575:5)
at Object.load (D:\Hexo\node_modules\js-yaml\lib\js-yaml\loader.js:1596:19)
at Hexo.yamlHelper (D:\Hexo\node_modules\hexo\lib\plugins\renderer\yaml.js:7:15)
at Hexo.tryCatcher (D:\Hexo\node_modules\bluebird\js\release\util.js:16:23)
at Hexo.<anonymous> (D:\Hexo\node_modules\bluebird\js\release\method.js:15:34)
at Promise.then.text (D:\Hexo\node_modules\hexo\lib\hexo\render.js:75:22)
at tryCatcher (D:\Hexo\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (D:\Hexo\node_modules\bluebird\js\release\promise.js:547:31)
at Promise._settlePromise (D:\Hexo\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (D:\Hexo\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (D:\Hexo\node_modules\bluebird\js\release\promise.js:729:18)
at _drainQueueStep (D:\Hexo\node_modules\bluebird\js\release\async.js:93:12)
at _drainQueue (D:\Hexo\node_modules\bluebird\js\release\async.js:86:9)
at Async._drainQueues (D:\Hexo\node_modules\bluebird\js\release\async.js:102:5)
at Immediate.Async.drainQueues (D:\Hexo\node_modules\bluebird\js\release\async.js:15:14)
at runCallback (timers.js:810:20)
at tryOnImmediate (timers.js:768:5)
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
Error: Cannot find module 'cheerio'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (D:\Hexo\node_modules\hexo\lib\hexo\index.js:280:23)
at Hexo.hexo.extend.filter.register.data (D:\Hexo\themes\Butterfly\scripts\highlight.js:4:19)
at Hexo.tryCatcher (D:\Hexo\node_modules\bluebird\js\release\util.js:16:23)
at Hexo.<anonymous> (D:\Hexo\node_modules\bluebird\js\release\method.js:15:34)
at Promise.each.filter (D:\Hexo\node_modules\hexo\lib\extend\filter.js:62:52)
at tryCatcher (D:\Hexo\node_modules\bluebird\js\release\util.js:16:23)
at Object.gotValue (D:\Hexo\node_modules\bluebird\js\release\reduce.js:166:18)
at Object.gotAccum (D:\Hexo\node_modules\bluebird\js\release\reduce.js:155:25)
at Object.tryCatcher (D:\Hexo\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (D:\Hexo\node_modules\bluebird\js\release\promise.js:547:31)
at Promise._settlePromise (D:\Hexo\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (D:\Hexo\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (D:\Hexo\node_modules\bluebird\js\release\promise.js:729:18)
at _drainQueueStep (D:\Hexo\node_modules\bluebird\js\release\async.js:93:12)
at _drainQueue (D:\Hexo\node_modules\bluebird\js\release\async.js:86:9)
at Async._drainQueues (D:\Hexo\node_modules\bluebird\js\release\async.js:102:5)
at Immediate.Async.drainQueues (D:\Hexo\node_modules\bluebird\js\release\async.js:15:14)
at runCallback (timers.js:810:20)
at tryOnImmediate (timers.js:768:5)

解决办法:

This is due to a yaml format error, please check the location.

  1. In yaml, there should be a space between the colon and the value of the property.
  • yearly: true ✔️
  • yearlu:true
  1. Attributes should be correctly indented

问题2.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
tony@DESKTOP-DLE9QF3 MINGW64 /d/Hexo
$ hexo g
INFO Start processing
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
Error: Cannot find module 'cheerio'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (D:\Hexo\node_modules\hexo\lib\hexo\index.js:280:23)
at Hexo.hexo.extend.filter.register.data (D:\Hexo\themes\Butterfly\scripts\highlight.js:4:19)
at Hexo.tryCatcher (D:\Hexo\node_modules\bluebird\js\release\util.js:16:23)
at Hexo.<anonymous> (D:\Hexo\node_modules\bluebird\js\release\method.js:15:34)
at Promise.each.filter (D:\Hexo\node_modules\hexo\lib\extend\filter.js:62:52)
at tryCatcher (D:\Hexo\node_modules\bluebird\js\release\util.js:16:23)
at Object.gotValue (D:\Hexo\node_modules\bluebird\js\release\reduce.js:166:18)
at Object.gotAccum (D:\Hexo\node_modules\bluebird\js\release\reduce.js:155:25)
at Object.tryCatcher (D:\Hexo\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (D:\Hexo\node_modules\bluebird\js\release\promise.js:547:31)
at Promise._settlePromise (D:\Hexo\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (D:\Hexo\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (D:\Hexo\node_modules\bluebird\js\release\promise.js:729:18)
at _drainQueueStep (D:\Hexo\node_modules\bluebird\js\release\async.js:93:12)
at _drainQueue (D:\Hexo\node_modules\bluebird\js\release\async.js:86:9)
at Async._drainQueues (D:\Hexo\node_modules\bluebird\js\release\async.js:102:5)
at Immediate.Async.drainQueues (D:\Hexo\node_modules\bluebird\js\release\async.js:15:14)
at runCallback (timers.js:810:20)
at tryOnImmediate (timers.js:768:5)

解决办法:

Error: Cannot find module ‘cheerio’,就是找不到这个模块了,安装上就行了。

如果升级到hexo 4.2.0 ,会出现报错

Error: Cannot find module ‘cheerio’

请在博客根目录安装heerio

npm install cheerio@0.22.0 –save

1
2
3
4
5
6
7
8
9
10
11
12
13
tony@DESKTOP-DLE9QF3 MINGW64 /d/Hexo
$ npm install cheerio
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules\nunjucks\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules\hexo-encrypt\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules\hexo-blog-encrypt\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ cheerio@1.0.0-rc.3
added 16 packages in 15.066s
文章作者: 蕾米亚
文章链接: http://omimo.ga/2020/741ba5b1.html
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 彭彭和丁满
打赏
  • 微信
    微信
  • 支付寶
    支付寶

评论