前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Hexo-报错解决记录

Hexo-报错解决记录

作者头像
闲花手札
发布2021-12-27 08:59:16
6150
发布2021-12-27 08:59:16
举报
文章被收录于专栏:闲花手札

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:\Users\L\Desktop\MyBlog-matery\node_modules\hexo-baidu-url-submit\lib\generator.js:4:41)
    at Hexo.tryCatcher (C:\Users\L\Desktop\MyBlog-matery\node_modules\bluebird\js\release\util.js:16:23)
    at Hexo. (C:\Users\L\Desktop\MyBlog-matery\node_modules\bluebird\js\release\method.js:15:34)
    at C:\Users\L\Desktop\MyBlog-matery\node_modules\hexo\lib\hexo\qipao.js:380:22
    at tryCatcher (C:\Users\L\Desktop\MyBlog-matery\node_modules\bluebird\js\release\util.js:16:23)
    at MappingPromiseArray._promiseFulfilled (C:\Users\L\Desktop\MyBlog-matery\node_modules\bluebird\js\release\map.js:68:38)
    at MappingPromiseArray.PromiseArray._iterate (C:\Users\L\Desktop\MyBlog-matery\node_modules\bluebird\js\release\promise_array.js:115:31)
    at MappingPromiseArray.init (C:\Users\L\Desktop\MyBlog-matery\node_modules\bluebird\js\release\promise_array.js:79:10)
    at MappingPromiseArray._asyncInit (C:\Users\L\Desktop\MyBlog-matery\node_modules\bluebird\js\release\map.js:37:10)
    at _drainQueueStep (C:\Users\L\Desktop\MyBlog-matery\node_modules\bluebird\js\release\async.js:97:12)
    at _drainQueue (C:\Users\L\Desktop\MyBlog-matery\node_modules\bluebird\js\release\async.js:86:9)
    at Async._drainQueues (C:\Users\L\Desktop\MyBlog-matery\node_modules\bluebird\js\release\async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (C:\Users\L\Desktop\MyBlog-matery\node_modules\bluebird\js\release\async.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;
}
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2021-03-14,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • hexo generate (hexo g)
    • Cannot read property ‘count’ of undefined
      • 部署或本地预览网页为空白
        • 代码高亮问题({}被编译成#234)
          • 卜蒜子统计未显示问题
          领券
          问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档