Closed liaochenlanruo closed 3 years ago
您可以检查一下 /home/liu/blogs/themes/Kratos-Rebirth/layout/_partial/head.ejs
该文件是否存在,如果不存在可能是主题下载时候出现了文件缺失,您可以尝试修正。
如果文件存在而还是报错,可能是因为版本的问题,请问您可以提供一下您的 Node 和 hexo 版本吗?非常感谢您的帮助!
文件都在,我发现刚开始运行的时候就有报错,信息如下,请大佬帮忙看看能否找到什么线索
(base) liu@hualin:~/blogs$ hexo g INFO Validating config INFO Start processing ERROR { err: SyntaxError: Unexpected token . in /home/liu/blogs/themes/Kratos-Rebirth/layout/post.ejs while compiling ejs
If the above error is not helpful, you may want to try EJS-Lint:
https://github.com/RyanZim/EJS-Lint
Or, if you meant to create an async function, pass async: true
as an option.
at new Function (
If the above error is not helpful, you may want to try EJS-Lint:
https://github.com/RyanZim/EJS-Lint
Or, if you meant to create an async function, pass async: true
as an option.
at new Function (
您可以检查一下
/home/liu/blogs/themes/Kratos-Rebirth/layout/_partial/head.ejs
该文件是否存在,如果不存在可能是主题下载时候出现了文件缺失,您可以尝试修正。如果文件存在而还是报错,可能是因为版本的问题,请问您可以提供一下您的 Node 和 hexo 版本吗?非常感谢您的帮助!
多谢大佬指点!不好意思,昨晚有点犯迷糊,没看到您说的版本问题。出错原因是我更新了最新版本的主题release,然而npm(7.6.3)和node(v10.19.0)的版本太低了,随后更新了一下npm(7.21.1)和node(v14.17.5),再进行hexo g一切正常。
好的,解决了就好,有任何其他问题欢迎随时联系!
hexo g报错
ERROR { Error: /home/liu/blogs/themes/Kratos-Rebirth/layout/layout.ejs:3 1| <!DOCTYPE html> 2|
Partial _partial/head does not exist. (in layout.ejs) at Object.partial (/home/liu/blogs/node_modules/hexo/lib/plugins/helper/partial.js:16:11) at eval (/home/liu/blogs/themes/Kratos-Rebirth/layout/layout.ejs:15:17) at layout (/home/liu/blogs/node_modules/ejs/lib/ejs.js:682:17) at _View._compiled.locals [as _compiled] (/home/liu/blogs/node_modules/hexo/lib/theme/view.js:136:50) at _View.render (/home/liu/blogs/node_modules/hexo/lib/theme/view.js:39:17) at _compiled.then.result (/home/liu/blogs/node_modules/hexo/lib/theme/view.js:51:25) at tryCatcher (/home/liu/blogs/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/home/liu/blogs/node_modules/bluebird/js/release/promise.js:547:31) at Promise._settlePromise (/home/liu/blogs/node_modules/bluebird/js/release/promise.js:604:18) at Promise._settlePromise0 (/home/liu/blogs/node_modules/bluebird/js/release/promise.js:649:10) at Promise._settlePromises (/home/liu/blogs/node_modules/bluebird/js/release/promise.js:729:18) at _drainQueueStep (/home/liu/blogs/node_modules/bluebird/js/release/async.js:93:12) at _drainQueue (/home/liu/blogs/node_modules/bluebird/js/release/async.js:86:9) at Async._drainQueues (/home/liu/blogs/node_modules/bluebird/js/release/async.js:102:5) at Immediate.Async.drainQueues [as _onImmediate] (/home/liu/blogs/node_modules/bluebird/js/release/async.js:15:14) at runCallback (timers.js:705:18) at tryOnImmediate (timers.js:676:5) at processImmediate (timers.js:658:5) path: '/home/liu/blogs/themes/Kratos-Rebirth/layout/layout.ejs' }
请问如何解决?谢谢!