刚才发布文章,出现了神奇的报错,然后我部署到github上发现没部署上,很是疑惑。
经过研究发现原来是这么回事!

首先报上一波,我开发的运行环境

运行环境 Runtime environment

1
2
3
操作系统 : Windows10
浏览器: Google Chrome 版本 67.0.3396.99(正式版本) (64 位)&& FireFox Developer Edition 版本63.0b4 (64位)
IDE: JetBrains Pycharm 2018.2.1 x64

症状

执行“hexo clean&&hexo g&&hexo s”命令后,出现can not read a block mapping entry的报错。

保存信息具体如下:

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
ERROR Process failed: _posts/奇技淫巧:Ubuntu软件包有关命令的整理.md
YAMLException: can not read a block mapping entry; a multiline key may not be an implicit key at line 6, column 1:

^
at generateError (D:\workspace\nodejs\DeSireFireBlog\node_modules\js-yaml\lib\js-yaml\loader.js:165:10)
at throwError (D:\workspace\nodejs\DeSireFireBlog\node_modules\js-yaml\lib\js-yaml\loader.js:171:9)
at readBlockMapping (D:\workspace\nodejs\DeSireFireBlog\node_modules\js-yaml\lib\js-yaml\loader.js:1046:9)
at composeNode (D:\workspace\nodejs\DeSireFireBlog\node_modules\js-yaml\lib\js-yaml\loader.js:1332:12)
at readDocument (D:\workspace\nodejs\DeSireFireBlog\node_modules\js-yaml\lib\js-yaml\loader.js:1492:3)
at loadDocuments (D:\workspace\nodejs\DeSireFireBlog\node_modules\js-yaml\lib\js-yaml\loader.js:1548:5)
at Object.load (D:\workspace\nodejs\DeSireFireBlog\node_modules\js-yaml\lib\js-yaml\loader.js:1569:19)
at parseYAML (D:\workspace\nodejs\DeSireFireBlog\node_modules\hexo-front-matter\lib\front_matter.js:80:21)
at parse (D:\workspace\nodejs\DeSireFireBlog\node_modules\hexo-front-matter\lib\front_matter.js:56:12)
at Promise.all.spread (D:\workspace\nodejs\DeSireFireBlog\node_modules\hexo\lib\plugins\processor\post.js:52:20)
at tryCatcher (D:\workspace\nodejs\DeSireFireBlog\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (D:\workspace\nodejs\DeSireFireBlog\node_modules\bluebird\js\release\promise.js:509:35)
at Promise._settlePromise (D:\workspace\nodejs\DeSireFireBlog\node_modules\bluebird\js\release\promise.js:569:18)
at Promise._settlePromise0 (D:\workspace\nodejs\DeSireFireBlog\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (D:\workspace\nodejs\DeSireFireBlog\node_modules\bluebird\js\release\promise.js:694:18)
at Promise._fulfill (D:\workspace\nodejs\DeSireFireBlog\node_modules\bluebird\js\release\promise.js:638:18)
at PromiseArray._resolve (D:\workspace\nodejs\DeSireFireBlog\node_modules\bluebird\js\release\promise_array.js:126:19)
at PromiseArray._promiseFulfilled (D:\workspace\nodejs\DeSireFireBlog\node_modules\bluebird\js\release\promise_array.js:144:14)
at PromiseArray._iterate (D:\workspace\nodejs\DeSireFireBlog\node_modules\bluebird\js\release\promise_array.js:114:31)
at PromiseArray.init [as _init] (D:\workspace\nodejs\DeSireFireBlog\node_modules\bluebird\js\release\promise_array.js:78:10)
at Promise._settlePromise (D:\workspace\nodejs\DeSireFireBlog\node_modules\bluebird\js\release\promise.js:566:21)
at Promise._settlePromise0 (D:\workspace\nodejs\DeSireFireBlog\node_modules\bluebird\js\release\prom

解决办法

发现是因为tag后面我不小心把“:”整没了

1
2
3
4
5
6
7
title: '疑难杂症:ubuntu18.04中解决pip的ImportError: cannot import name main问题'
date: 2018-09-23 20:13:32
tags
- hexo
- Web
- IT技术

tags冒号后面应当有个空格,其他地方也应当注意

1
2
3
4
5
6
7
title: '疑难杂症:ubuntu18.04中解决pip的ImportError: cannot import name main问题'
date: 2018-09-23 20:13:32
tags:
- hexo
- Web
- IT技术

即可解决这个问题!