ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

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

2021-07-01 13:01:24  阅读:1323  来源: 互联网

标签:node hexoblog hexo mathALL modules js 报错 ubuntu home


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,这样可以避免异常。

标签:node,hexoblog,hexo,mathALL,modules,js,报错,ubuntu,home
来源: https://blog.csdn.net/baidu_20313315/article/details/118384409

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有