IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    hexo 升级 5.4.0 出现错误解决方法 -hexo-theme-butterfly

    Max Fang (maxfang007@gmail.com)发表于 2023-04-19 15:03:53
    love 0

    周末升级了下 hexo 到新版本,发现升级后,构建时出现了一些错误,以下是出现的问题,及解决方法。

    • WARN Deprecated config detected: “external_link” with a Boolean value is deprecated. See https://hexo.io/docs/configuration for more details.

    修改 _config.yml 文件,将如下内容做调整。

    1
    external_link: true

    将上面的内容,修改为如下内容。

    1
    2
    3
    4
    external_link:
    enable: true # Open external links in new tab
    field: site # Apply to the whole site
    exclude: ''
    • err: TypeError: Cannot read property ‘bind’ of undefined
    1
    2
    3
    err: TypeError: Cannot read property 'bind' of undefined
    ...
    Script load failed: %s themes/butterfly/scripts/filters/post_lazyload.js

    一般出现类似错误是由于升级 hexo 后,其余依赖未升级完全,可以考虑删除依赖,重新 install。

    1
    2
    3
    4
    5
    6
    npm cache clean --force
    rm -rf node_modules
    rm package-lock.json
    npm install
    hexo clean
    hexo g

    可以参考 git 主题项目中的 issues-406 。



沪ICP备19023445号-2号
友情链接