环境
软件: Typora
规范: GFM(hexo-renderer-markdown-it)
Hexo版本: 3.8.0
系统: Windows10 version1903
踩坑经历
-
TypeError: Cannot read property ‘utcOffset’ of null
一般是hexo目前的文件夹中的_config.yml配置文件里的
language
和timezone
两个选项的设置有问题, 可以参考一下设置:language options default English zh-CN 简体中文 fr-FR French zh-HK/zh-TW 繁体中文 ru Russian de German timezone: Asia/Shanghai
(时区选择) -
YAMLException: can not read a block mapping entry; a multiline key may not be an implicit key at line 4, column 1
原因: YUML要求冒号后面需要添加一格空格, 然后衔接内容值, 所以这里出现的问题是字符的编码不符合标准造成的编译器读取失败造成的.
解决办法: 一般是Markdown编辑时格式的问题, 可以尝试在冒号的后面
空一格
, 然后衔接内容.Notice
: 在其他文本编辑器中编辑过的内容, 复制到md中的, 有可能会出现格式问题, 以及字符可能会被文本编辑器"污染". -
ERROR Deployer not found: git
原因:
hexo d
部署时出现上述错误解决办法:
npm install hexo-deployer-git --save
-
npm install 运行出错
[email protected] requires a peer of [email protected]>=4.12.1 but none is installed.You must install peer dependencies yourself.
我们只需要安装相应的包就可以了:
1
npm install [email protected]1 [email protected] --save-dev
Notice:
需要注意输入的命令中的程序版本与错误提示的版本号. -
TypeError: Cannot set property ‘lastIndex’ of undefined
原因: 由于
highlight.js
检测代码语言引起解决办法: 在
_config.yml
中的auto_detect
是用来自动检测语言的, 所以, 打开_config.yml
更改一下配置:1
2
3
4
5highlight:
enable: true
line_number: false
auto_detect: false(更改此处)
tab_replace: