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


相关文章
|
3月前
|
数据库 Python
Traceback(most recent call last):File "main.py", line 4l,in<module>alueError: sleep length must be n
Traceback(most recent call last):File "main.py", line 4l,in<module>alueError: sleep length must be n
|
5月前
|
XML 移动开发 数据格式
【Python】已解决:bs4.FeatureNotFound: Couldn’t find a tree builder with the features you requested: html5
【Python】已解决:bs4.FeatureNotFound: Couldn’t find a tree builder with the features you requested: html5
496 1
|
5月前
|
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
166 0
|
5月前
|
开发者 Python
【Python】已解决:TypeError: descriptor ‘index‘ for ‘list‘ objects doesn‘t apply to a ‘str‘ object
【Python】已解决:TypeError: descriptor ‘index‘ for ‘list‘ objects doesn‘t apply to a ‘str‘ object
152 0
|
7月前
|
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
91 0
|
7月前
|
JSON 缓存 前端开发
Unexpected end of JSON input while parsing near '....1","eslint-loader":"'
Unexpected end of JSON input while parsing near '....1","eslint-loader":"'
74 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.
199 0
Newline required at end of file but not found.
|
PyTorch 算法框架/工具
THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=405 error=11 : invalid argument
THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=405 error=11 : invalid argument
231 0
THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=405 error=11 : invalid argument
|
JSON 数据格式 索引
Elastic:doc[‘field‘].value与params._source[‘field‘]的区别;doc循环依赖问题
今天有同学问到doc['field'].value与params._source['field']用法的区别,起因在于下述的一道题的解法上,下面详细讲述下我的看法
210 0
Elastic:doc[‘field‘].value与params._source[‘field‘]的区别;doc循环依赖问题