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号
---


相关文章
|
5月前
|
存储 设计模式 缓存
《500 Lines or Less》(4)Contingent: A Fully Dynamic Build System(构建系统)
《500 Lines or Less》(4)Contingent: A Fully Dynamic Build System(构建系统)
|
4月前
|
XML 数据格式 Python
【Python】已解决:xml.parsers.expat.ExpatError: no element found: Line 1, column 0
【Python】已解决:xml.parsers.expat.ExpatError: no element found: Line 1, column 0
113 0
|
6月前
|
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
76 0
|
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
83 0
|
编译器 C语言
__FILE__, __LINE__ __FUNCTION__
__FILE__, __LINE__ __FUNCTION__
Newline required at end of file but not found.
Newline required at end of file but not found.
179 0
Newline required at end of file but not found.
|
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 解决方案
2099 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
运行 ‘ApiApplication‘ 出错: Command line is too long. Shorten command line for ShopApiApplication or
运行 ‘ApiApplication‘ 出错: Command line is too long. Shorten command line for ShopApiApplication or
231 0
运行 ‘ApiApplication‘ 出错: Command line is too long. Shorten command line for ShopApiApplication or
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