疑难杂症:incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line at…


运行环境 Runtime environment

1
2
3
4
5
操作系统: Windos10  
IDE: webStrom 2021.3.1 x64
语言: nodeJs v14.15.4
框架: hexo "5.3.0"
theme: [Butterfly "3.6.1"]

症状

写完博客,使用命令

hexo clean&&hexo g&&hexo s

出现了报错(节选):

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
ERROR {
err: YAMLException: incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line at line 5, column 52:
... +报错pyppeteer.errors.BrowserError: Browser closed unexpectedly:解决办法
^
at generateError (F:\workSpace\myHexo\node_modules\js-yaml\lib\js-yaml\loader.js:167:10)
at throwError (F:\workSpace\myHexo\node_modules\js-yaml\lib\js-yaml\loader.js:173:9)
at readBlockMapping (F:\workSpace\myHexo\node_modules\js-yaml\lib\js-yaml\loader.js:1027:9)
at composeNode (F:\workSpace\myHexo\node_modules\js-yaml\lib\js-yaml\loader.js:1359:12)
at readDocument (F:\workSpace\myHexo\node_modules\js-yaml\lib\js-yaml\loader.js:1525:3)
at loadDocuments (F:\workSpace\myHexo\node_modules\js-yaml\lib\js-yaml\loader.js:1588:5)
at Object.load (F:\workSpace\myHexo\node_modules\js-yaml\lib\js-yaml\loader.js:1614:19)
at parseYAML (F:\workSpace\myHexo\node_modules\hexo-front-matter\lib\front_matter.js:69:23)
at parse (F:\workSpace\myHexo\node_modules\hexo-front-matter\lib\front_matter.js:50:12)
at F:\workSpace\myHexo\node_modules\hexo\lib\plugins\processor\post.js:51:20
at tryCatcher (F:\workSpace\myHexo\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (F:\workSpace\myHexo\node_modules\bluebird\js\release\promise.js:544:35)
at Promise._settlePromise (F:\workSpace\myHexo\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (F:\workSpace\myHexo\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (F:\workSpace\myHexo\node_modules\bluebird\js\release\promise.js:729:18)
at Promise._fulfill (F:\workSpace\myHexo\node_modules\bluebird\js\release\promise.js:673:18)
at PromiseArray._resolve (F:\workSpace\myHexo\node_modules\bluebird\js\release\promise_array.js:127:19)
at PromiseArray._promiseFulfilled (F:\workSpace\myHexo\node_modules\bluebird\js\release\promise_array.js:145:14)
at PromiseArray._iterate (F:\workSpace\myHexo\node_modules\bluebird\js\release\promise_array.js:115:31)
at PromiseArray.init [as _init] (F:\workSpace\myHexo\node_modules\bluebird\js\release\promise_array.js:79:10)
at Promise._settlePromise (F:\workSpace\myHexo\node_modules\bluebird\js\release\promise.js:601:21)
at Promise._settlePromise0 (F:\workSpace\myHexo\node_modules\bluebird\js\release\promise.js:649:10) {
reason: 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line',
mark: Mark {
name: null,
buffer: "title: 'scrapy+报错pyppeteer.errors.BrowserError Browser closed unexpectedly 的解决办法'\n" +
'top_img: /customize/img/top/debug.jpg\n' +
'cover: /customize/img/top/debug.jpg\n' +
'comments: true\n' +
'description: scrapy+报错pyppeteer.errors.BrowserError: Browser closed unexpectedly:解决办法\n' +
'keywords:\n' +
' - scrapy\n' +
' - python\n' +
' - pyppeteer\n' +
'tags:\n' +
' - scrapy\n' +
' - python\n' +
' - pyppeteer\n' +
'categories:\n' +
' - 技术博文\n' +
'date: 2021-05-12 10:06:18\n' +
'updated: 2021-05-12 10:06:18\n' +
'\x00',
position: 222,
line: 4,
column: 51
}
}

问题原因

hexo g 发生此类报错,可能是因为md文件title中有冒号。

解决办法

英文的”:” 改成 中文的”:”。