vuepress build提示YAMLException: end of the stream or a document separator is expected at line 7, colu

简介: vuepress build提示YAMLException: end of the stream or a document separator is expected at line 7, colu

1、问题

vuePress执行build操作的时候

vuepress build ~/my_blogs/docs/


错误提示如下

YAMLException: end of the stream or a document separator is expected at line 7, column 9:
    features:
            ^
    at generateError (/usr/lib/node_modules/vuepress/node_modules/js-yaml/lib/js-yaml/loader.js:167:10)
    at throwError (/usr/lib/node_modules/vuepress/node_modules/js-yaml/lib/js-yaml/loader.js:173:9)
    at readDocument (/usr/lib/node_modules/vuepress/node_modules/js-yaml/lib/js-yaml/loader.js:1545:5)
    at loadDocuments (/usr/lib/node_modules/vuepress/node_modules/js-yaml/lib/js-yaml/loader.js:1588:5)
    at load (/usr/lib/node_modules/vuepress/node_modules/js-yaml/lib/js-yaml/loader.js:1614:19)
    at Object.safeLoad (/usr/lib/node_modules/vuepress/node_modules/js-yaml/lib/js-yaml/loader.js:1637:10)
    at module.exports (/usr/lib/node_modules/vuepress/node_modules/gray-matter/lib/parse.js:12:17)
    at parseMatter (/usr/lib/node_modules/vuepress/node_modules/gray-matter/index.js:109:17)
    at Object.matter [as default] (/usr/lib/node_modules/vuepress/node_modules/gray-matter/index.js:50:10)
    at parseFrontmatter (/usr/lib/node_modules/vuepress/node_modules/@vuepress/shared-utils/lib/parseFrontmatter.js:8:33)
    at Page.process (/usr/lib/node_modules/vuepress/node_modules/@vuepress/core/lib/node/Page.js:106:44)
    at async App.addPage (/usr/lib/node_modules/vuepress/node_modules/@vuepress/core/lib/node/App.js:354:5)
    at async /usr/lib/node_modules/vuepress/node_modules/@vuepress/core/lib/node/App.js:339:7
    at async Promise.all (index 0)
    at async App.resolvePages (/usr/lib/node_modules/vuepress/node_modules/@vuepress/core/lib/node/App.js:337:5)
    at async App.process (/usr/lib/node_modules/vuepress/node_modules/@vuepress/core/lib/node/App.js:115:5)

2、原因

我的READMDE.md文件格式有问题

---
home:true
heroImage:/hero.png
heroText:Hero标题
tagline:Hero副标题
actionText:快速上手→
actionLink:/zh/guide/
features:
- title:简洁至上
  details:以Markdown为中心的项目结构,以最少的配置帮助你专注于写作。
- title:Vue驱动
  details:享受Vue+ webpack 的开发体验,在Markdown中使用Vue组件,同时可以使用Vue来开发自定义主题。
- title:高性能
  details:VuePress为每个页面预渲染生成静态的 HTML,同时在页面被加载的时候,将作为 SPA 运行。
footer: MIT Licensed|Copyright©2018-present EvanYou
---root@iZm5e6dk6exl71zbx327zvZ:~/my_blogs/docs# 

3、解决办法

:后面需要加上空格,修复后的README.md文件如下

---
home: true
heroText: Hero标题
tagline: Hero副标题
actionText: 快速上手→
actionLink: /README.md
features:
- title: 简洁至上
  details: 以Markdown为中心的项目结构,以最少的配置帮助你专注于写作。
- title: Vue驱动
  details: 享受Vue+ webpack 的开发体验,在Markdown中使用Vue组件,同时可以使用Vue来开发自定义主题。
- title: 高性能
  details: VuePress为每个页面预渲染生成静态的 HTML,同时在页面被加载的时候,将作为 SPA 运行。
footer: MIT Licensed|Copyright©2020-present 湘ICP备 20001035号
---


相关文章
|
1月前
|
IDE 开发工具 Android开发
Couldn‘t get post build model. Module:UpdateService_0804.main Variant: debugOpen logcat panel fo
Couldn‘t get post build model. Module:UpdateService_0804.main Variant: debugOpen logcat panel fo
31 0
|
6月前
DeprecationWarning:current URL string parser is deprecated, and will be removed in a future version.
DeprecationWarning:current URL string parser is deprecated, and will be removed in a future version.
|
7月前
|
Java
IDEA-解决Command line is too long. Shorten command line for SpringBootMainApplication or also for App
IDEA-解决Command line is too long. Shorten command line for SpringBootMainApplication or also for App
46 0
|
8月前
|
编译器 C语言
__FILE__, __LINE__ __FUNCTION__
__FILE__, __LINE__ __FUNCTION__
|
10月前
|
Python
Python POST data should be bytes, an iterable of bytes, or a file object. It ...
Python POST data should be bytes, an iterable of bytes, or a file object. It ...
84 0
|
Java
IDEA 启动服务报错:Command line is too long. Shorten the command line via JAR manifest or via a classpath file and rerun 解决方案
IDEA 启动服务报错:Command line is too long. Shorten the command line via JAR manifest or via a classpath file and rerun 解决方案
1613 1
|
TensorFlow 算法框架/工具 Python
成功解决File "frozen importlib._bootstrap", line 219, in _call_with_frames_removed ImportError: DLL lo
成功解决File "frozen importlib._bootstrap", line 219, in _call_with_frames_removed ImportError: DLL lo
成功解决File "frozen importlib._bootstrap", line 219, in _call_with_frames_removed ImportError: DLL lo
Could not find com.serenegiant:common:4.1.1
Could not find com.serenegiant:common:4.1.1
208 0
|
JSON 数据格式 索引
Elastic:doc[‘field‘].value与params._source[‘field‘]的区别;doc循环依赖问题
今天有同学问到doc['field'].value与params._source['field']用法的区别,起因在于下述的一道题的解法上,下面详细讲述下我的看法
166 0
Elastic:doc[‘field‘].value与params._source[‘field‘]的区别;doc循环依赖问题
Cannot find source code based button in SE24
When you are logging on to customer system for incident handling, you want to switch to source code to perform some keyword search. However, you could not find button “Source code based builder” in toolbar, with following warning message: ———————————————— 版权声明:本文为CSDN博主「汪子熙」的原创文章,遵循CC 4.0 BY-SA版权协
Cannot find source code based button in SE24