hexo g报错,line.mathALL is not funciton问题解决

hexo g报错,line.mathALL is not funciton问题解决

有问必答
ubuntu@VM-16-13-ubuntu:~/hexoblog$ sudo hexo s
INFO Validating config
INFO Start processing
FATAL { err:
TypeError: line.matchAll is not a function
at res.value.res.value.split.map.line (/home/ubuntu/hexoblog/node_modules/hexo-util/lib/highlight.js:128:26)
at Array.map ()
at closeTags (/home/ubuntu/hexoblog/node_modules/hexo-util/lib/highlight.js:126:37)
at highlight (/home/ubuntu/hexoblog/node_modules/hexo-util/lib/highlight.js:119:10)
at highlightUtil (/home/ubuntu/hexoblog/node_modules/hexo-util/lib/highlight.js:23:16)
at data.content.dataContent.replace (/home/ubuntu/hexoblog/node_modules/hexo/lib/plugins/filter/before_post_render/backtick_code_block.js:92:17)
at String.replace ()
at Hexo.backtickCodeBlock (/home/ubuntu/hexoblog/node_modules/hexo/lib/plugins/filter/before_post_render/backtick_code_block.js:19:30)
at Hexo.tryCatcher (/home/ubuntu/hexoblog/node_modules/bluebird/js/release/util.js:16:23)
at Hexo. (/home/ubuntu/hexoblog/node_modules/bluebird/js/release/method.js:15:34)
at Promise.each.filter (/home/ubuntu/hexoblog/node_modules/hexo/lib/extend/filter.js:67:52)
at tryCatcher (/home/ubuntu/hexoblog/node_modules/bluebird/js/release/util.js:16:23)
at Object.gotValue (/home/ubuntu/hexoblog/node_modules/bluebird/js/release/reduce.js:166:18)
at Object.gotAccum (/home/ubuntu/hexoblog/node_modules/bluebird/js/release/reduce.js:155:25)
at Object.tryCatcher (/home/ubuntu/hexoblog/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/ubuntu/hexoblog/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/home/ubuntu/hexoblog/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromiseCtx (/home/ubuntu/hexoblog/node_modules/bluebird/js/release/promise.js:641:10)
at _drainQueueStep (/home/ubuntu/hexoblog/node_modules/bluebird/js/release/async.js:97:12)
at _drainQueue (/home/ubuntu/hexoblog/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/home/ubuntu/hexoblog/node_modules/bluebird/js/release/async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (/home/ubuntu/hexoblog/node_modules/bluebird/js/release/async.js:15:14) } ‘Something’s wrong. Maybe you can find the solution here: %s’ ‘\u001b[4mhttps://hexo.io/docs/troubleshooting.html\u001b[24m’

原因

  • 是node版本问题,针对于低版本node问题,node12.0.0以上就没有这个问题

解决方法

  • 版本12.0.0的Node.js中支持String.matchAll()

  • 两种解决方法

    • ① 请将nodejs升级到高于12.0.0的版本。

    • ② config.xml中的 highlight->enable的值从true更改为false,这样可以避免异常。

  • 8
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值