hexo server

发布于 2022-09-02 16:07:09 字数 4262 浏览 17 评论 0

我的hexo能成功部署 且大开链接也有效果 只是每次在hexo s 的时候会有瑕疵,有如下错误:

➜  blog  hexo s
INFO  Start processing
ERROR Process failed: layout/.DS_Store
TypeError: Cannot read property 'compile' of undefined
    at View._precompile (/Users/idisfkj/blog/node_modules/hexo/lib/theme/view.js:104:22)
    at View (/Users/idisfkj/blog/node_modules/hexo/lib/theme/view.js:13:8)
    at new Theme._View.View (/Users/idisfkj/blog/node_modules/hexo/lib/theme/index.js:37:10)
    at Theme.setView (/Users/idisfkj/blog/node_modules/hexo/lib/theme/index.js:71:20)
    at /Users/idisfkj/blog/node_modules/hexo/lib/theme/processors/view.js:14:14
    at tryCatcher (/Users/idisfkj/blog/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/idisfkj/blog/node_modules/bluebird/js/release/promise.js:503:31)
    at Promise._settlePromise (/Users/idisfkj/blog/node_modules/bluebird/js/release/promise.js:560:18)
    at Promise._settlePromise0 (/Users/idisfkj/blog/node_modules/bluebird/js/release/promise.js:605:10)
    at Promise._settlePromises (/Users/idisfkj/blog/node_modules/bluebird/js/release/promise.js:684:18)
    at Promise._fulfill (/Users/idisfkj/blog/node_modules/bluebird/js/release/promise.js:629:18)
    at Promise._resolveCallback (/Users/idisfkj/blog/node_modules/bluebird/js/release/promise.js:424:57)
    at Promise._settlePromiseFromHandler (/Users/idisfkj/blog/node_modules/bluebird/js/release/promise.js:515:17)
    at Promise._settlePromise (/Users/idisfkj/blog/node_modules/bluebird/js/release/promise.js:560:18)
    at Promise._settlePromise0 (/Users/idisfkj/blog/node_modules/bluebird/js/release/promise.js:605:10)
    at Promise._settlePromises (/Users/idisfkj/blog/node_modules/bluebird/js/release/promise.js:684:18)
    at Promise._fulfill (/Users/idisfkj/blog/node_modules/bluebird/js/release/promise.js:629:18)
    at /Users/idisfkj/blog/node_modules/bluebird/js/release/nodeback.js:42:21
    at /Users/idisfkj/blog/node_modules/graceful-fs/graceful-fs.js:78:16
    at tryToString (fs.js:414:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:401:12)
ERROR Process failed: layout/_partial/.DS_Store
TypeError: Cannot read property 'compile' of undefined
    at View._precompile (/Users/idisfkj/blog/node_modules/hexo/lib/theme/view.js:104:22)
    at View (/Users/idisfkj/blog/node_modules/hexo/lib/theme/view.js:13:8)
    at new Theme._View.View (/Users/idisfkj/blog/node_modules/hexo/lib/theme/index.js:37:10)
    at Theme.setView (/Users/idisfkj/blog/node_modules/hexo/lib/theme/index.js:71:20)
    at /Users/idisfkj/blog/node_modules/hexo/lib/theme/processors/view.js:14:14
    at tryCatcher (/Users/idisfkj/blog/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/idisfkj/blog/node_modules/bluebird/js/release/promise.js:503:31)
    at Promise._settlePromise (/Users/idisfkj/blog/node_modules/bluebird/js/release/promise.js:560:18)
    at Promise._settlePromise0 (/Users/idisfkj/blog/node_modules/bluebird/js/release/promise.js:605:10)
    at Promise._settlePromises (/Users/idisfkj/blog/node_modules/bluebird/js/release/promise.js:684:18)
    at Promise._fulfill (/Users/idisfkj/blog/node_modules/bluebird/js/release/promise.js:629:18)
    at Promise._resolveCallback (/Users/idisfkj/blog/node_modules/bluebird/js/release/promise.js:424:57)
    at Promise._settlePromiseFromHandler (/Users/idisfkj/blog/node_modules/bluebird/js/release/promise.js:515:17)
    at Promise._settlePromise (/Users/idisfkj/blog/node_modules/bluebird/js/release/promise.js:560:18)
    at Promise._settlePromise0 (/Users/idisfkj/blog/node_modules/bluebird/js/release/promise.js:605:10)
    at Promise._settlePromises (/Users/idisfkj/blog/node_modules/bluebird/js/release/promise.js:684:18)
    at Promise._fulfill (/Users/idisfkj/blog/node_modules/bluebird/js/release/promise.js:629:18)
    at /Users/idisfkj/blog/node_modules/bluebird/js/release/nodeback.js:42:21
    at /Users/idisfkj/blog/node_modules/graceful-fs/graceful-fs.js:78:16
    at tryToString (fs.js:414:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:401:12)
INFO  Hexo is running at http://localhost:4000/. Press Ctrl+C to stop.

虽然能成功 但每次看到这个心里就不爽,(强迫症)
有碰到这种情况的兄弟吗? 如何解决。

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

三生一梦 2022-09-09 16:07:09

把 .DS_Store 删了试试……

[旋木] 2022-09-09 16:07:09

有可能配置文件有问题,但我的遇到的情况跟你这个不大一样。我是hexo s启动之后,会报各种各样的错误,但不影响使用。

望喜 2022-09-09 16:07:09

你用的主题的js有报错

木緿 2022-09-09 16:07:09

cd 进到你使用的theme对应的目录,再进到layout/和layout/_partial/下.
分别执行rm .DS_Store

旧伤慢歌 2022-09-09 16:07:09

这个报错貌似不会影响到使用,但还是挺恶心的。

目录切到你所用那个主题的主目录的样式文件目录,以我的为例

cd themes/maupassant/layout

ls -al 列出所有信息包裹隐藏文件

rm -fr .DS_Store 删除

再执行 hexo generate就没有报错了

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文