Hexo-报错解决记录

2021-12-27 08:59:16 浏览数 (1)

hexo generate (hexo g)

Cannot read property ‘count’ of undefined

代码语言:javascript复制
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
TypeError: Cannot read property 'count' of undefined
    at Hexo.module.exports (C:UsersLDesktopMyBlog-materynode_moduleshexo-baidu-url-submitlibgenerator.js:4:41)
    at Hexo.tryCatcher (C:UsersLDesktopMyBlog-materynode_modulesbluebirdjsreleaseutil.js:16:23)
    at Hexo. (C:UsersLDesktopMyBlog-materynode_modulesbluebirdjsreleasemethod.js:15:34)
    at C:UsersLDesktopMyBlog-materynode_moduleshexolibhexoqipao.js:380:22
    at tryCatcher (C:UsersLDesktopMyBlog-materynode_modulesbluebirdjsreleaseutil.js:16:23)
    at MappingPromiseArray._promiseFulfilled (C:UsersLDesktopMyBlog-materynode_modulesbluebirdjsreleasemap.js:68:38)
    at MappingPromiseArray.PromiseArray._iterate (C:UsersLDesktopMyBlog-materynode_modulesbluebirdjsreleasepromise_array.js:115:31)
    at MappingPromiseArray.init (C:UsersLDesktopMyBlog-materynode_modulesbluebirdjsreleasepromise_array.js:79:10)
    at MappingPromiseArray._asyncInit (C:UsersLDesktopMyBlog-materynode_modulesbluebirdjsreleasemap.js:37:10)
    at _drainQueueStep (C:UsersLDesktopMyBlog-materynode_modulesbluebirdjsreleaseasync.js:97:12)
    at _drainQueue (C:UsersLDesktopMyBlog-materynode_modulesbluebirdjsreleaseasync.js:86:9)
    at Async._drainQueues (C:UsersLDesktopMyBlog-materynode_modulesbluebirdjsreleaseasync.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (C:UsersLDesktopMyBlog-materynode_modulesbluebirdjsreleaseasync.js:15:14)
    at processImmediate (internal/timers.js:439:21)

因百度主动提交插件导致,已安装插件却未完成 _config.yml的信息完善

解决方案

  1. 完善_config.yml
代码语言:javascript复制
# hexo-baidu-url-submit  百度主动推送
baidu_url_submit:
  count: 80 # 提交最新的一个链接
  host: blog.cn # 在百度站长平台中注册的域名
  token: TGtEmSO8ZImXXXXX # 请注意这是您的秘钥, 所以请不要把博客源代码发布在公众仓库里!
  path: baidu_urls.txt # 文本文档的地址, 新链接会保存在此文本文档里
  1. 删除百度主动推送插件
代码语言:javascript复制
npm remove hexo-baidu-url-submit
hexo clean
hexo g

部署或本地预览网页为空白

运行hexo g 命令没有问题,但是编辑器打开 public 文件生成的 index.html中代码未自动生成

因 node.js 的版本过高

解决方案

降低 node.js 版本,建议使用 node.js (12.13.0)

node.js 12.X 版本传送门

代码高亮问题({}被编译成#234)

在你博客的根目录。 输入指令 npm uninstall hexo --save 卸载 现在的版本 在输入 npm install hexo@加要安装的版本 --save即可

eg:npm install hexo@4.2.0 --save

卜蒜子统计未显示问题

matery.css中添加如下代码

代码语言:javascript复制
#busuanzi_container_site_pv,
#busuanzi_value_site_pv,
#busuanzi_container_site_uv {
  display: inline !important;
}

0 人点赞