君苏依寂 发表于 2021-10-6 21:38:49

hexo 创建新文章不成功

使用hexo new <title>命令创建文章式报下面这个错误,上网查找说是时区不对,然后又将主题文件下的时区改成了上海,但是还是不对;然后又经过查看发现是缩进不对,但是不知道怎么进行修改,希望能有人帮助一下,笔芯,86157@LAPTOP-G3TT1IA6 MINGW64 /d/博客
$ hexo new "title"
INFOValidating config
ERROR {
err: Error: : the provided password_hash looks like an md5 hash -- hexo-admin has switched to use bcrypt; see the Readme for more info.
      at D:\博客\node_modules\hexo-admin\index.js:14:11
      at D:\博客\node_modules\hexo\lib\hexo\index.js:305:14
      at tryCatcher (D:\博客\node_modules\bluebird\js\release\util.js:16:23)
      at Promise._settlePromiseFromHandler (D:\博客\node_modules\bluebird\js\release\promise.js:547:31)
      at Promise._settlePromise (D:\博客\node_modules\bluebird\js\release\promise.js:604:18)
      at Promise._settlePromise0 (D:\博客\node_modules\bluebird\js\release\promise.js:649:10)
      at Promise._settlePromises (D:\博客\node_modules\bluebird\js\release\promise.js:729:18)
      at _drainQueueStep (D:\博客\node_modules\bluebird\js\release\async.js:93:12)
      at _drainQueue (D:\博客\node_modules\bluebird\js\release\async.js:86:9)
      at Async._drainQueues (D:\博客\node_modules\bluebird\js\release\async.js:102:5)
      at Immediate.Async.drainQueues (D:\博客\node_modules\bluebird\js\release\async.js:15:14)
      at processImmediate (internal/timers.js:464:21)
} Plugin load failed: %s hexo-admin
INFO
===================================================================

      ######    # ##### ##### ###### ########### #      #   #
      #    # #    #   #   #   #      #    # #      #       # #
      ######    #   #   #   ######    # ######      #
      #    # #    #   #   #   #      ######      #      #
      #    # #    #   #   #   #      #   ##      #      #
      #####   ####    #   #   ###### #    # #      ######   #

                            3.8.4
===================================================================
FATAL {
err: YAMLException: bad indentation of a mapping entry (9:17)

    6 | toc: true
    7 | mathjax: true
    8 | summary:
    9 | tags: categories:
----------------------^
   10 | ​---
      at generateError (D:\博客\node_modules\js-yaml\lib\loader.js:183:10)
      at throwError (D:\博客\node_modules\js-yaml\lib\loader.js:187:9)
      at readBlockMapping (D:\博客\node_modules\js-yaml\lib\loader.js:1182:7)
      at composeNode (D:\博客\node_modules\js-yaml\lib\loader.js:1441:12)
      at readDocument (D:\博客\node_modules\js-yaml\lib\loader.js:1625:3)
      at loadDocuments (D:\博客\node_modules\js-yaml\lib\loader.js:1688:5)
      at load (D:\博客\node_modules\js-yaml\lib\loader.js:1714:19)
      at D:\博客\node_modules\hexo\lib\hexo\post.js:152:63
      at tryCatcher (D:\博客\node_modules\bluebird\js\release\util.js:16:23)
      at Promise._settlePromiseFromHandler (D:\博客\node_modules\bluebird\js\release\promise.js:547:31)
      at Promise._settlePromise (D:\博客\node_modules\bluebird\js\release\promise.js:604:18)
      at Promise._settlePromise0 (D:\博客\node_modules\bluebird\js\release\promise.js:649:10)
      at Promise._settlePromises (D:\博客\node_modules\bluebird\js\release\promise.js:729:18)
      at Promise._fulfill (D:\博客\node_modules\bluebird\js\release\promise.js:673:18)
      at Promise._settlePromise (D:\博客\node_modules\bluebird\js\release\promise.js:617:21)
      at Promise._settlePromise0 (D:\博客\node_modules\bluebird\js\release\promise.js:649:10)
      at Promise._settlePromises (D:\博客\node_modules\bluebird\js\release\promise.js:729:18)
      at Promise._fulfill (D:\博客\node_modules\bluebird\js\release\promise.js:673:18)
      at D:\博客\node_modules\bluebird\js\release\nodeback.js:42:21
      at D:\博客\node_modules\nunjucks\src\environment.js:41:5
      at RawTask.call (D:\博客\node_modules\asap\asap.js:40:19)
      at flush (D:\博客\node_modules\asap\raw.js:50:29) {
    reason: 'bad indentation of a mapping entry',
    mark: {
      name: null,
      buffer: '​--- title: title \n' +
      'date: 2021-10-06 13:30:47 \n' +
      'top: false \n' +
      'cover: false \n' +
      'password: \n' +
      'toc: true \n' +
      'mathjax: true \n' +
      'summary: \n' +
      'tags: categories: \n' +
      '​---\n',
      position: 135,
      line: 8,
      column: 16,
      snippet: '6 | toc: true \n' +
      '7 | mathjax: true \n' +
      '8 | summary: \n' +
      '9 | tags: categories: \n' +
      '----------------------^\n' +
      ' 10 | ​---'
    }
}
} Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html

86157@LAPTOP-G3TT1IA6 MINGW64 /d/博客
$

Ⅲ只小猪 发表于 2021-10-6 21:38:50

找不出来的话可以回滚到上一个正确的版本
git reset HEAD^
# ^ 代表回滚一个版本,^^代表两个

阿奇_o 发表于 2021-10-6 22:36:55

虽然没用过Hexo,但从报错信息看:直接原因是 YAML文件的缩进有问题,导致解析错误。
——它有写的 reason: 'bad indentation of a mapping entry',
——它说在第8行?,你检查一下缩进,以及是否可能因复制粘贴混入了不可见的特殊字符。
YAML类型的配置文件是有严格的缩进规则,它给出的问题排查网址的第一个就是关于 YAML语法解析的错误。

你自己检查吧。

君苏依寂 发表于 2021-10-7 12:55:16

阿奇_o 发表于 2021-10-6 22:36
虽然没用过Hexo,但从报错信息看:直接原因是 YAML文件的缩进有问题,导致解析错误。
——它有写的 reason ...

我想问的是哪一个yaml文件有问题

阿奇_o 发表于 2021-10-7 16:20:36

君苏依寂 发表于 2021-10-7 12:55
我想问的是哪一个yaml文件有问题

你修改过的是哪个? _config.yml ?

我不清楚的哦,你慢慢排查吧~
页: [1]
查看完整版本: hexo 创建新文章不成功