hexo日常报错维护

注:遇到报错应自行排查,或首先查看hexo官方问题解答板块内容(链接:hexo官方问题答疑)。

意外的标记异常(1)

1.异常内容如下:

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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
INFO Deleted database.
INFO Start processing
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Template render error: (unknown path) [Line 3, Column 198]
unexpected token: }}
at Object.exports.prettifyError (/Users/a001/GitHub/qumuase.github.io/node_modules/.2.5.2@nunjucks/src/lib.js:34:15)
at new_cls.render (/Users/a001/GitHub/qumuase.github.io/node_modules/.2.5.2@nunjucks/src/environment.js:469:27)
at new_cls.renderString (/Users/a001/GitHub/qumuase.github.io/node_modules/.2.5.2@nunjucks/src/environment.js:327:21)
at /Users/a001/GitHub/qumuase.github.io/node_modules/.3.2.2@hexo/lib/extend/tag.js:66:9
at Promise._execute (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.4.7@bluebird/js/release/debuggability.js:300:9)
at Promise._resolveFromExecutor (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.4.7@bluebird/js/release/promise.js:481:18)
at new Promise (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.4.7@bluebird/js/release/promise.js:77:14)
at Tag.render (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.2.2@hexo/lib/extend/tag.js:64:10)
at Object.tagFilter [as onRenderEnd] (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.2.2@hexo/lib/hexo/post.js:253:16)
at /Users/a001/GitHub/qumuase.github.io/node_modules/.3.2.2@hexo/lib/hexo/render.js:65:19
at tryCatcher (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.4.7@bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.4.7@bluebird/js/release/promise.js:510:31)
at Promise._settlePromise (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.4.7@bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.4.7@bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.4.7@bluebird/js/release/promise.js:691:18)
at Async._drainQueue (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.4.7@bluebird/js/release/async.js:133:16)
at Async._drainQueues (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.4.7@bluebird/js/release/async.js:143:10)
at Immediate.Async.drainQueues (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.4.7@bluebird/js/release/async.js:17:14)
at runCallback (timers.js:574:20)
at tryOnImmediate (timers.js:554:5)
at processImmediate [as _immediateCallback] (timers.js:533:5)
FATAL (unknown path) [Line 3, Column 198]
unexpected token: }}
Template render error: (unknown path) [Line 3, Column 198]
unexpected token: }}
at Object.exports.prettifyError (/Users/a001/GitHub/qumuase.github.io/node_modules/.2.5.2@nunjucks/src/lib.js:34:15)
at new_cls.render (/Users/a001/GitHub/qumuase.github.io/node_modules/.2.5.2@nunjucks/src/environment.js:469:27)
at new_cls.renderString (/Users/a001/GitHub/qumuase.github.io/node_modules/.2.5.2@nunjucks/src/environment.js:327:21)
at /Users/a001/GitHub/qumuase.github.io/node_modules/.3.2.2@hexo/lib/extend/tag.js:66:9
at Promise._execute (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.4.7@bluebird/js/release/debuggability.js:300:9)
at Promise._resolveFromExecutor (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.4.7@bluebird/js/release/promise.js:481:18)
at new Promise (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.4.7@bluebird/js/release/promise.js:77:14)
at Tag.render (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.2.2@hexo/lib/extend/tag.js:64:10)
at Object.tagFilter [as onRenderEnd] (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.2.2@hexo/lib/hexo/post.js:253:16)
at /Users/a001/GitHub/qumuase.github.io/node_modules/.3.2.2@hexo/lib/hexo/render.js:65:19
at tryCatcher (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.4.7@bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.4.7@bluebird/js/release/promise.js:510:31)
at Promise._settlePromise (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.4.7@bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.4.7@bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.4.7@bluebird/js/release/promise.js:691:18)
at Async._drainQueue (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.4.7@bluebird/js/release/async.js:133:16)
at Async._drainQueues (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.4.7@bluebird/js/release/async.js:143:10)
at Immediate.Async.drainQueues (/Users/a001/GitHub/qumuase.github.io/node_modules/.3.4.7@bluebird/js/release/async.js:17:14)
at runCallback (timers.js:574:20)
at tryOnImmediate (timers.js:554:5)
at processImmediate [as _immediateCallback] (timers.js:533:5)

2.原因

这种类型的报错一般都是Markdown文章中使用了大括号{ }这个特殊字符,且没有转义导致编译时冲突未通过。

3.解决方法

可以参考Markdown语法规范,将{ }大括号通过 { } 进行转码处理。

意外的标记异常(2)

1.异常内容如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
fatal: unable to access 'http://github.com/qumuase/qumuase.github.io.git/': Recv failure: Connection reset by peer
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: fatal: unable to access 'http://github.com/qumuase/qumuase.github.io.git/': Recv failure: Connection reset by peer
at ChildProcess.<anonymous> (/Users/a001/GitHub/qumuase.github.io/node_modules/.0.6.0@hexo-util/lib/spawn.js:37:17)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
FATAL fatal: unable to access 'http://github.com/qumuase/qumuase.github.io.git/': Recv failure: Connection reset by peer
Error: fatal: unable to access 'http://github.com/qumuase/qumuase.github.io.git/': Recv failure: Connection reset by peer
at ChildProcess.<anonymous> (/Users/a001/GitHub/qumuase.github.io/node_modules/.0.6.0@hexo-util/lib/spawn.js:37:17)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

2.原因

这种类型的报错一般都是Markdown文章中使用了斜杠这个特殊字符,且没有转义导致编译时冲突未通过。

3.解决方法

可以参考Markdown语法规范,将斜杠(英文)通过 &#47; ,或斜杠(中文)通过&#65295;进行转码处理。
同时也可以将相关符号用代码(Markdown语法:``)包裹起来即可。

意外的标记异常(3)

1.异常内容如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
fatal: unable to access 'http://github.com/qumuase/qumuase.github.io.git/': Recv failure: Connection reset by peer
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: fatal: unable to access 'http://github.com/qumuase/qumuase.github.io.git/': Recv failure: Connection reset by peer
at ChildProcess.<anonymous> (/Users/a001/GitHub/qumuase.github.io/node_modules/.0.6.0@hexo-util/lib/spawn.js:37:17)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
FATAL fatal: unable to access 'http://github.com/qumuase/qumuase.github.io.git/': Recv failure: Connection reset by peer
Error: fatal: unable to access 'http://github.com/qumuase/qumuase.github.io.git/': Recv failure: Connection reset by peer
at ChildProcess.<anonymous> (/Users/a001/GitHub/qumuase.github.io/node_modules/.0.6.0@hexo-util/lib/spawn.js:37:17)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

2.原因

这种类型的报错经排查是因为在文章头部只有单个tags或者单个categories的时候使用了中括号的原因。

1
2
tags: [hexo]
categories: [hexo]

3.解决方法

添加多标签或者多分类,或者删除中括号,直接填写单个标签或者分类。

1
2
tags: [hexo,技巧]
categories: [hexo,技巧]

意外的标记异常(4)

1.异常内容如下:

hexo d 单独执行异常,抛出错误。

1
2
fatal: unable to access 'http://github.com/qumuase/qumuase.github.io.git/': Could not resolve host: github.com
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html

2.原因

未知。。。(或许是电脑重启后开启了两个 Hexo 服务器)
一种新的可能:过程中断网(含泪)。
墙的原因。(已排除)

3.解决方法

重启iTerm

sitemap报错

1.打开网站 sitemap.xml 报错信息如下:

2.原因
在GitHub中查看 sitemap.xml 发现以下问题:

同时在Xcode中打开本地 sitemap.xml 文件此位置同样是加红报错状态。
这是由于特殊符号在 xml 文件中是不能显示且会报错,需要经过转义字符来进行特殊处理。

3.解决方法
source/_posts/ 下对应文章的标题及title中的 & 等特殊符号替换为转义字符 &amp; 等即可。

特殊符号 对应编码 意义
< \< 小于
> \> 大于
& \&
\' 单引号
\" 双引号