Hexo: TypeError: Cannot set property 'lastIndex' of undefined

  使用Hexo部署的过程中报出以下错误。

FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
TypeError: Cannot set property 'lastIndex' of undefined
    at highlight (/Users/vosang/CoderCenter/blog/node_modules/highlight.js/lib/highlight.js:511:35)
    at /Users/vosang/CoderCenter/blog/node_modules/highlight.js/lib/highlight.js:561:21
    at Array.forEach ()
    at Object.highlightAuto (/Users/vosang/CoderCenter/blog/node_modules/highlight.js/lib/highlight.js:560:40)
    at /Users/vosang/CoderCenter/blog/node_modules/hexo-util/lib/highlight.js:100:25
    at highlight (/Users/vosang/CoderCenter/blog/node_modules/hexo-util/lib/highlight.js:103:7)
    at highlightUtil (/Users/vosang/CoderCenter/blog/node_modules/hexo-util/lib/highlight.js:22:14)
    at /Users/vosang/CoderCenter/blog/node_modules/hexo/lib/plugins/filter/before_post_render/backtick_code_block.js:62:15
    at String.replace ()
    at Hexo.backtickCodeBlock (/Users/vosang/CoderCenter/blog/node_modules/hexo/lib/plugins/filter/before_post_render/backtick_code_block.js:15:31)
    at Hexo.tryCatcher (/Users/vosang/CoderCenter/blog/node_modules/bluebird/js/release/util.js:16:23)
    at Hexo. (/Users/vosang/CoderCenter/blog/node_modules/bluebird/js/release/method.js:15:34)
    at /Users/vosang/CoderCenter/blog/node_modules/hexo/lib/extend/filter.js:68:35
    at tryCatcher (/Users/vosang/CoderCenter/blog/node_modules/bluebird/js/release/util.js:16:23)
    at Object.gotValue (/Users/vosang/CoderCenter/blog/node_modules/bluebird/js/release/reduce.js:155:18)
    at Object.gotAccum (/Users/vosang/CoderCenter/blog/node_modules/bluebird/js/release/reduce.js:144:25)
    at Object.tryCatcher (/Users/vosang/CoderCenter/blog/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/vosang/CoderCenter/blog/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/Users/vosang/CoderCenter/blog/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromiseCtx (/Users/vosang/CoderCenter/blog/node_modules/bluebird/js/release/promise.js:606:10)
    at Async._drainQueue (/Users/vosang/CoderCenter/blog/node_modules/bluebird/js/release/async.js:138:12)
    at Async._drainQueues (/Users/vosang/CoderCenter/blog/node_modules/bluebird/js/release/async.js:143:10)

解决方法

修改配置文件_config.yml,注意不是主题里面的配置文件!
把auto_detect设置为false,即可解决。

你可能感兴趣的:(hexo)