Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

本地预览报错 #14

Closed
itzhouq opened this issue Nov 4, 2020 · 6 comments
Closed

本地预览报错 #14

itzhouq opened this issue Nov 4, 2020 · 6 comments

Comments

@itzhouq
Copy link

itzhouq commented Nov 4, 2020

  • 下载主题:
git clone https://github.com/giuem/hexo-theme-iris.git themes/iris
  • 进入 themes 文件夹
cd ./themes/iris
  • 复制配置文件
cp _config.example.yml _config.yml
ls
CODE_OF_CONDUCT.md  _config.example.yml gulpfile.babel.js   package.json        source
LICENSE             _config.yml         languages           postcss.config.js   src
README.md           babel.config.js     layout              scripts             yarn.lock
  • 使用主题
ls
README.md    _config.yml  db.json      node_modules package.json public       scaffolds    source       themes       yarn.lock

vim _config.yml
# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
# theme: landscape
theme: iris
  • 预览
hexo g

INFO  Validating config
INFO  Start processing
INFO  Files loaded in 96 ms
ERROR ReferenceError: /Users/itzhouq/dev/hexo-temp/themes/iris/layout/archive.ejs:1
 >> 1| <%- partial("_pages/archive") %>
    2|

/Users/itzhouq/dev/hexo-temp/themes/iris/layout/_pages/archive.ejs:1
 >> 1| <%
    2| var title = "";
    3| var type = "";
    4| var counter = 0;

_ is not defined
    at eval (/Users/itzhouq/dev/hexo-temp/themes/iris/layout/_pages/archive.ejs:36:13)
    at archive (/Users/itzhouq/dev/hexo-temp/node_modules/ejs/lib/ejs.js:682:17)
    at _View._compiledSync (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:132:24)
    at _View.renderSync (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:59:25)
    at Object.partial (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/plugins/helper/partial.js:34:15)
    at eval (/Users/itzhouq/dev/hexo-temp/themes/iris/layout/archive.ejs:10:17)
    at archive (/Users/itzhouq/dev/hexo-temp/node_modules/ejs/lib/ejs.js:682:17)
    at _View._compiled (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:136:50)
    at _View.render (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:39:17)
    at /Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/hexo/index.js:64:21
    at tryCatcher (/Users/itzhouq/dev/hexo-temp/node_modules/bluebird/js/release/util.js:16:23)
    at /Users/itzhouq/dev/hexo-temp/node_modules/bluebird/js/release/method.js:15:34
    at RouteStream._read (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/hexo/router.js:47:5)
    at RouteStream.Readable.read (_stream_readable.js:476:10)
    at resume_ (_stream_readable.js:963:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  path: '/Users/itzhouq/dev/hexo-temp/themes/iris/layout/archive.ejs'
}
ERROR ReferenceError: /Users/itzhouq/dev/hexo-temp/themes/iris/layout/archive.ejs:1
 >> 1| <%- partial("_pages/archive") %>
    2|

/Users/itzhouq/dev/hexo-temp/themes/iris/layout/_pages/archive.ejs:1
 >> 1| <%
    2| var title = "";
    3| var type = "";
    4| var counter = 0;

_ is not defined
    at eval (/Users/itzhouq/dev/hexo-temp/themes/iris/layout/_pages/archive.ejs:36:13)
    at archive (/Users/itzhouq/dev/hexo-temp/node_modules/ejs/lib/ejs.js:682:17)
    at _View._compiledSync (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:132:24)
    at _View.renderSync (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:59:25)
    at Object.partial (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/plugins/helper/partial.js:34:15)
    at eval (/Users/itzhouq/dev/hexo-temp/themes/iris/layout/archive.ejs:10:17)
    at archive (/Users/itzhouq/dev/hexo-temp/node_modules/ejs/lib/ejs.js:682:17)
    at _View._compiled (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:136:50)
    at _View.render (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:39:17)
    at /Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/hexo/index.js:64:21
    at tryCatcher (/Users/itzhouq/dev/hexo-temp/node_modules/bluebird/js/release/util.js:16:23)
    at /Users/itzhouq/dev/hexo-temp/node_modules/bluebird/js/release/method.js:15:34
    at RouteStream._read (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/hexo/router.js:47:5)
    at RouteStream.Readable.read (_stream_readable.js:476:10)
    at resume_ (_stream_readable.js:963:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  path: '/Users/itzhouq/dev/hexo-temp/themes/iris/layout/archive.ejs'
}
ERROR {
  err: TypeError: /Users/itzhouq/dev/hexo-temp/themes/iris/layout/layout.ejs:3
      1| <!DOCTYPE html>
      2| <html <% if(config.language) { %>lang="<%- config.language %>"<% } %>>
   >> 3|   <%- partial('_head/index') %>
      4|   <body data-instant-intensity="viewport">
      5|     <%- partial("_partial/header") %>
      6|     <main class="main">

  /Users/itzhouq/dev/hexo-temp/themes/iris/layout/_head/index.ejs:51
      49|   <%- partial("dns-prefetch", {}, {cache: true}) %>
      50|   <%- partial("favicon", {}, {cache: true}) %>
   >> 51|   <%- partial("rss", {}, {cache: true}) %>
      52|   <%- partial("open-graph", {meta}) %>
      53|   <%- partial("custom", {}, {cache: true}) %>
      54|

  /Users/itzhouq/dev/hexo-temp/themes/iris/layout/_head/rss.ejs:2
      1| <% if(theme.head.rss) { %>
   >> 2|   <% if(config.feed.type == "atom"){ %>
      3|     <link rel="alternate" type="application/atom+xml" href="<%= theme.head.rss || '#' %>">
      4|   <% } else if(config.feed.type == "rss2") { %>
      5|     <link rel="alternate" type="application/rss+xml" href="<%= theme.head.rss || '#' %>">

  Cannot read property 'type' of undefined
      at eval (/Users/itzhouq/dev/hexo-temp/themes/iris/layout/_head/rss.ejs:13:23)
      at rss (/Users/itzhouq/dev/hexo-temp/node_modules/ejs/lib/ejs.js:682:17)
      at _View._compiledSync (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:132:24)
      at _View.renderSync (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:59:25)
      at /Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/plugins/helper/partial.js:31:52
      at Cache.apply (/Users/itzhouq/dev/hexo-temp/node_modules/hexo-util/lib/cache.js:27:46)
      at Object.fragmentCache (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/plugins/helper/fragment_cache.js:11:34)
      at Object.partial (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/plugins/helper/partial.js:31:17)
      at eval (/Users/itzhouq/dev/hexo-temp/themes/iris/layout/_head/index.ejs:70:17)
      at index (/Users/itzhouq/dev/hexo-temp/node_modules/ejs/lib/ejs.js:682:17)
      at _View._compiledSync (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:132:24)
      at _View.renderSync (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:59:25)
      at Object.partial (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/plugins/helper/partial.js:34:15)
      at eval (/Users/itzhouq/dev/hexo-temp/themes/iris/layout/layout.ejs:19:17)
      at layout (/Users/itzhouq/dev/hexo-temp/node_modules/ejs/lib/ejs.js:682:17)
      at _View._compiled (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:136:50)
      at _View.render (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:39:17)
      at /Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:51:25
      at tryCatcher (/Users/itzhouq/dev/hexo-temp/node_modules/bluebird/js/release/util.js:16:23)
      at Promise._settlePromiseFromHandler (/Users/itzhouq/dev/hexo-temp/node_modules/bluebird/js/release/promise.js:547:31)
      at Promise._settlePromise (/Users/itzhouq/dev/hexo-temp/node_modules/bluebird/js/release/promise.js:604:18)
      at Promise._settlePromise0 (/Users/itzhouq/dev/hexo-temp/node_modules/bluebird/js/release/promise.js:649:10) {
    path: '/Users/itzhouq/dev/hexo-temp/themes/iris/layout/layout.ejs'
  }
} Render HTML failed: 2020/11/04/hello-world/index.html
ERROR {
  err: TypeError: /Users/itzhouq/dev/hexo-temp/themes/iris/layout/layout.ejs:3
      1| <!DOCTYPE html>
      2| <html <% if(config.language) { %>lang="<%- config.language %>"<% } %>>
   >> 3|   <%- partial('_head/index') %>
      4|   <body data-instant-intensity="viewport">
      5|     <%- partial("_partial/header") %>
      6|     <main class="main">

  /Users/itzhouq/dev/hexo-temp/themes/iris/layout/_head/index.ejs:51
      49|   <%- partial("dns-prefetch", {}, {cache: true}) %>
      50|   <%- partial("favicon", {}, {cache: true}) %>
   >> 51|   <%- partial("rss", {}, {cache: true}) %>
      52|   <%- partial("open-graph", {meta}) %>
      53|   <%- partial("custom", {}, {cache: true}) %>
      54|

  /Users/itzhouq/dev/hexo-temp/themes/iris/layout/_head/rss.ejs:2
      1| <% if(theme.head.rss) { %>
   >> 2|   <% if(config.feed.type == "atom"){ %>
      3|     <link rel="alternate" type="application/atom+xml" href="<%= theme.head.rss || '#' %>">
      4|   <% } else if(config.feed.type == "rss2") { %>
      5|     <link rel="alternate" type="application/rss+xml" href="<%= theme.head.rss || '#' %>">

  Cannot read property 'type' of undefined
      at eval (/Users/itzhouq/dev/hexo-temp/themes/iris/layout/_head/rss.ejs:13:23)
      at rss (/Users/itzhouq/dev/hexo-temp/node_modules/ejs/lib/ejs.js:682:17)
      at _View._compiledSync (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:132:24)
      at _View.renderSync (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:59:25)
      at /Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/plugins/helper/partial.js:31:52
      at Cache.apply (/Users/itzhouq/dev/hexo-temp/node_modules/hexo-util/lib/cache.js:27:46)
      at Object.fragmentCache (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/plugins/helper/fragment_cache.js:11:34)
      at Object.partial (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/plugins/helper/partial.js:31:17)
      at eval (/Users/itzhouq/dev/hexo-temp/themes/iris/layout/_head/index.ejs:70:17)
      at index (/Users/itzhouq/dev/hexo-temp/node_modules/ejs/lib/ejs.js:682:17)
      at _View._compiledSync (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:132:24)
      at _View.renderSync (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:59:25)
      at Object.partial (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/plugins/helper/partial.js:34:15)
      at eval (/Users/itzhouq/dev/hexo-temp/themes/iris/layout/layout.ejs:19:17)
      at layout (/Users/itzhouq/dev/hexo-temp/node_modules/ejs/lib/ejs.js:682:17)
      at _View._compiled (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:136:50)
      at _View.render (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:39:17)
      at /Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:51:25
      at tryCatcher (/Users/itzhouq/dev/hexo-temp/node_modules/bluebird/js/release/util.js:16:23)
      at Promise._settlePromiseFromHandler (/Users/itzhouq/dev/hexo-temp/node_modules/bluebird/js/release/promise.js:547:31)
      at Promise._settlePromise (/Users/itzhouq/dev/hexo-temp/node_modules/bluebird/js/release/promise.js:604:18)
      at Promise._settlePromise0 (/Users/itzhouq/dev/hexo-temp/node_modules/bluebird/js/release/promise.js:649:10) {
    path: '/Users/itzhouq/dev/hexo-temp/themes/iris/layout/layout.ejs'
  }
} Render HTML failed: index.html
ERROR TypeError: /Users/itzhouq/dev/hexo-temp/themes/iris/layout/layout.ejs:3
    1| <!DOCTYPE html>
    2| <html <% if(config.language) { %>lang="<%- config.language %>"<% } %>>
 >> 3|   <%- partial('_head/index') %>
    4|   <body data-instant-intensity="viewport">
    5|     <%- partial("_partial/header") %>
    6|     <main class="main">

/Users/itzhouq/dev/hexo-temp/themes/iris/layout/_head/index.ejs:51
    49|   <%- partial("dns-prefetch", {}, {cache: true}) %>
    50|   <%- partial("favicon", {}, {cache: true}) %>
 >> 51|   <%- partial("rss", {}, {cache: true}) %>
    52|   <%- partial("open-graph", {meta}) %>
    53|   <%- partial("custom", {}, {cache: true}) %>
    54|

/Users/itzhouq/dev/hexo-temp/themes/iris/layout/_head/rss.ejs:2
    1| <% if(theme.head.rss) { %>
 >> 2|   <% if(config.feed.type == "atom"){ %>
    3|     <link rel="alternate" type="application/atom+xml" href="<%= theme.head.rss || '#' %>">
    4|   <% } else if(config.feed.type == "rss2") { %>
    5|     <link rel="alternate" type="application/rss+xml" href="<%= theme.head.rss || '#' %>">

Cannot read property 'type' of undefined
    at eval (/Users/itzhouq/dev/hexo-temp/themes/iris/layout/_head/rss.ejs:13:23)
    at rss (/Users/itzhouq/dev/hexo-temp/node_modules/ejs/lib/ejs.js:682:17)
    at _View._compiledSync (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:132:24)
    at _View.renderSync (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:59:25)
    at /Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/plugins/helper/partial.js:31:52
    at Cache.apply (/Users/itzhouq/dev/hexo-temp/node_modules/hexo-util/lib/cache.js:27:46)
    at Object.fragmentCache (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/plugins/helper/fragment_cache.js:11:34)
    at Object.partial (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/plugins/helper/partial.js:31:17)
    at eval (/Users/itzhouq/dev/hexo-temp/themes/iris/layout/_head/index.ejs:70:17)
    at index (/Users/itzhouq/dev/hexo-temp/node_modules/ejs/lib/ejs.js:682:17)
    at _View._compiledSync (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:132:24)
    at _View.renderSync (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:59:25)
    at Object.partial (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/plugins/helper/partial.js:34:15)
    at eval (/Users/itzhouq/dev/hexo-temp/themes/iris/layout/layout.ejs:19:17)
    at layout (/Users/itzhouq/dev/hexo-temp/node_modules/ejs/lib/ejs.js:682:17)
    at _View._compiled (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:136:50)
    at _View.render (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:39:17)
    at /Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:51:25
    at tryCatcher (/Users/itzhouq/dev/hexo-temp/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/itzhouq/dev/hexo-temp/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/Users/itzhouq/dev/hexo-temp/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/Users/itzhouq/dev/hexo-temp/node_modules/bluebird/js/release/promise.js:649:10) {
  path: '/Users/itzhouq/dev/hexo-temp/themes/iris/layout/layout.ejs'
}
ERROR TypeError: /Users/itzhouq/dev/hexo-temp/themes/iris/layout/layout.ejs:3
    1| <!DOCTYPE html>
    2| <html <% if(config.language) { %>lang="<%- config.language %>"<% } %>>
 >> 3|   <%- partial('_head/index') %>
    4|   <body data-instant-intensity="viewport">
    5|     <%- partial("_partial/header") %>
    6|     <main class="main">

/Users/itzhouq/dev/hexo-temp/themes/iris/layout/_head/index.ejs:51
    49|   <%- partial("dns-prefetch", {}, {cache: true}) %>
    50|   <%- partial("favicon", {}, {cache: true}) %>
 >> 51|   <%- partial("rss", {}, {cache: true}) %>
    52|   <%- partial("open-graph", {meta}) %>
    53|   <%- partial("custom", {}, {cache: true}) %>
    54|

/Users/itzhouq/dev/hexo-temp/themes/iris/layout/_head/rss.ejs:2
    1| <% if(theme.head.rss) { %>
 >> 2|   <% if(config.feed.type == "atom"){ %>
    3|     <link rel="alternate" type="application/atom+xml" href="<%= theme.head.rss || '#' %>">
    4|   <% } else if(config.feed.type == "rss2") { %>
    5|     <link rel="alternate" type="application/rss+xml" href="<%= theme.head.rss || '#' %>">

Cannot read property 'type' of undefined
    at eval (/Users/itzhouq/dev/hexo-temp/themes/iris/layout/_head/rss.ejs:13:23)
    at rss (/Users/itzhouq/dev/hexo-temp/node_modules/ejs/lib/ejs.js:682:17)
    at _View._compiledSync (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:132:24)
    at _View.renderSync (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:59:25)
    at /Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/plugins/helper/partial.js:31:52
    at Cache.apply (/Users/itzhouq/dev/hexo-temp/node_modules/hexo-util/lib/cache.js:27:46)
    at Object.fragmentCache (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/plugins/helper/fragment_cache.js:11:34)
    at Object.partial (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/plugins/helper/partial.js:31:17)
    at eval (/Users/itzhouq/dev/hexo-temp/themes/iris/layout/_head/index.ejs:70:17)
    at index (/Users/itzhouq/dev/hexo-temp/node_modules/ejs/lib/ejs.js:682:17)
    at _View._compiledSync (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:132:24)
    at _View.renderSync (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:59:25)
    at Object.partial (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/plugins/helper/partial.js:34:15)
    at eval (/Users/itzhouq/dev/hexo-temp/themes/iris/layout/layout.ejs:19:17)
    at layout (/Users/itzhouq/dev/hexo-temp/node_modules/ejs/lib/ejs.js:682:17)
    at _View._compiled (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:136:50)
    at _View.render (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:39:17)
    at /Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:51:25
    at tryCatcher (/Users/itzhouq/dev/hexo-temp/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/itzhouq/dev/hexo-temp/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/Users/itzhouq/dev/hexo-temp/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/Users/itzhouq/dev/hexo-temp/node_modules/bluebird/js/release/promise.js:649:10) {
  path: '/Users/itzhouq/dev/hexo-temp/themes/iris/layout/layout.ejs'
}
ERROR ReferenceError: /Users/itzhouq/dev/hexo-temp/themes/iris/layout/archive.ejs:1
 >> 1| <%- partial("_pages/archive") %>
    2|

/Users/itzhouq/dev/hexo-temp/themes/iris/layout/_pages/archive.ejs:1
 >> 1| <%
    2| var title = "";
    3| var type = "";
    4| var counter = 0;

_ is not defined
    at eval (/Users/itzhouq/dev/hexo-temp/themes/iris/layout/_pages/archive.ejs:36:13)
    at archive (/Users/itzhouq/dev/hexo-temp/node_modules/ejs/lib/ejs.js:682:17)
    at _View._compiledSync (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:132:24)
    at _View.renderSync (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:59:25)
    at Object.partial (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/plugins/helper/partial.js:34:15)
    at eval (/Users/itzhouq/dev/hexo-temp/themes/iris/layout/archive.ejs:10:17)
    at archive (/Users/itzhouq/dev/hexo-temp/node_modules/ejs/lib/ejs.js:682:17)
    at _View._compiled (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:136:50)
    at _View.render (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/theme/view.js:39:17)
    at /Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/hexo/index.js:64:21
    at tryCatcher (/Users/itzhouq/dev/hexo-temp/node_modules/bluebird/js/release/util.js:16:23)
    at /Users/itzhouq/dev/hexo-temp/node_modules/bluebird/js/release/method.js:15:34
    at RouteStream._read (/Users/itzhouq/dev/hexo-temp/node_modules/hexo/lib/hexo/router.js:47:5)
    at RouteStream.Readable.read (_stream_readable.js:476:10)
    at resume_ (_stream_readable.js:963:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  path: '/Users/itzhouq/dev/hexo-temp/themes/iris/layout/archive.ejs'
}
INFO  0 files generated in 29 ms

必要的插件 hexo-renderer-ejs已经安装,但是还是报错,请问如何解决。

@giuem
Copy link
Owner

giuem commented Nov 4, 2020

Hexo 版本太高了,没做兼容,3.8应该是ok的

@itzhouq
Copy link
Author

itzhouq commented Nov 7, 2020

Hexo 版本太高了,没做兼容,3.8 应该是 ok 的

卸载高版本的 hexo。使用

sudo npm install hexo@3.8 -g

命令安装 3.8 版本的还是报这个错误。

@XiaoPika
Copy link

XiaoPika commented Nov 8, 2020

我也来+1了 QAQ
Hexo 5.2 和 Hexo 3.8 完整安装 README.md 中所有推荐的插件,配置完成 _config.yml
环境:CloudStudio Nodejs V10.16.0
hexo s 均报以下错误:

ERROR { err:
   { ReferenceError: /root/RemoteWorking/themes/iris/layout/layout.ejs:5
       3|   <%- partial('_head/index') %>
       4|   <body data-instant-intensity="viewport">
    >> 5|     <%- partial("_partial/header") %>
       6|     <main class="main">
       7|       <%- body %> 
       8|     </main>
   
   /root/RemoteWorking/themes/iris/layout/_partial/header.ejs:16
       14|     </div>
       15|     <div class="header__right">
    >> 16|       <%- partial("nav") %>
       17|     </div>
       18|   </div>
       19| </header>
   
   /root/RemoteWorking/themes/iris/layout/_partial/nav.ejs:6
       4|   <div class="nav-wrapper">
       5|     <ul>
    >> 6|       <% _.forIn(theme.header.nav, function(link, name){ %>
       7|         <li><a class="nav-link <%- is_current(link) ? 'nav-link__active' : '' %>" href="<%= link %>"><%= name %></a></li>
       8|       <% }) %>
       9|     </ul>
   
   _ is not defined
       at eval (/root/RemoteWorking/themes/iris/layout/_partial/nav.ejs:13:8)
       at nav (/root/RemoteWorking/node_modules/_ejs@2.7.4@ejs/lib/ejs.js:682:17)
       at _View._compiledSync.locals [as _compiledSync] (/root/RemoteWorking/node_modules/hexo/lib/theme/view.js:132:24)
       at _View.renderSync (/root/RemoteWorking/node_modules/hexo/lib/theme/view.js:59:25)
       at Object.partial (/root/RemoteWorking/node_modules/hexo/lib/plugins/helper/partial.js:34:15)
       at eval (/root/RemoteWorking/themes/iris/layout/_partial/header.ejs:31:17)
       at header (/root/RemoteWorking/node_modules/_ejs@2.7.4@ejs/lib/ejs.js:682:17)
       at _View._compiledSync.locals [as _compiledSync] (/root/RemoteWorking/node_modules/hexo/lib/theme/view.js:132:24)
       at _View.renderSync (/root/RemoteWorking/node_modules/hexo/lib/theme/view.js:59:25)
       at Object.partial (/root/RemoteWorking/node_modules/hexo/lib/plugins/helper/partial.js:34:15)
       at eval (/root/RemoteWorking/themes/iris/layout/layout.ejs:22:17)
       at layout (/root/RemoteWorking/node_modules/_ejs@2.7.4@ejs/lib/ejs.js:682:17)
       at _View._compiled.locals [as _compiled] (/root/RemoteWorking/node_modules/hexo/lib/theme/view.js:136:50)
       at _View.render (/root/RemoteWorking/node_modules/hexo/lib/theme/view.js:39:17)
       at _compiled.then.result (/root/RemoteWorking/node_modules/hexo/lib/theme/view.js:51:25)
       at tryCatcher (/root/RemoteWorking/node_modules/bluebird/js/release/util.js:16:23)
       at Promise._settlePromiseFromHandler (/root/RemoteWorking/node_modules/bluebird/js/release/promise.js:547:31)
       at Promise._settlePromise (/root/RemoteWorking/node_modules/bluebird/js/release/promise.js:604:18)
       at Promise._settlePromise0 (/root/RemoteWorking/node_modules/bluebird/js/release/promise.js:649:10)
       at Promise._settlePromises (/root/RemoteWorking/node_modules/bluebird/js/release/promise.js:729:18)
       at _drainQueueStep (/root/RemoteWorking/node_modules/bluebird/js/release/async.js:93:12)
       at _drainQueue (/root/RemoteWorking/node_modules/bluebird/js/release/async.js:86:9)
       at Async._drainQueues (/root/RemoteWorking/node_modules/bluebird/js/release/async.js:102:5)
       at Immediate.Async.drainQueues [as _onImmediate] (/root/RemoteWorking/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: '/root/RemoteWorking/themes/iris/layout/layout.ejs' } } 'Render HTML failed: \u001b[35mindex.html\u001b[39m'
Unhandled rejection ReferenceError: /root/RemoteWorking/themes/iris/layout/layout.ejs:5
    3|   <%- partial('_head/index') %>
    4|   <body data-instant-intensity="viewport">
 >> 5|     <%- partial("_partial/header") %>
    6|     <main class="main">
    7|       <%- body %> 
    8|     </main>

/root/RemoteWorking/themes/iris/layout/_partial/header.ejs:16
    14|     </div>
    15|     <div class="header__right">
 >> 16|       <%- partial("nav") %>
    17|     </div>
    18|   </div>
    19| </header>

/root/RemoteWorking/themes/iris/layout/_partial/nav.ejs:6
    4|   <div class="nav-wrapper">
    5|     <ul>
 >> 6|       <% _.forIn(theme.header.nav, function(link, name){ %>
    7|         <li><a class="nav-link <%- is_current(link) ? 'nav-link__active' : '' %>" href="<%= link %>"><%= name %></a></li>
    8|       <% }) %>
    9|     </ul>

_ is not defined
    at eval (/root/RemoteWorking/themes/iris/layout/_partial/nav.ejs:13:8)
    at nav (/root/RemoteWorking/node_modules/_ejs@2.7.4@ejs/lib/ejs.js:682:17)
    at _View._compiledSync.locals [as _compiledSync] (/root/RemoteWorking/node_modules/hexo/lib/theme/view.js:132:24)
    at _View.renderSync (/root/RemoteWorking/node_modules/hexo/lib/theme/view.js:59:25)
    at Object.partial (/root/RemoteWorking/node_modules/hexo/lib/plugins/helper/partial.js:34:15)
    at eval (/root/RemoteWorking/themes/iris/layout/_partial/header.ejs:31:17)
    at header (/root/RemoteWorking/node_modules/_ejs@2.7.4@ejs/lib/ejs.js:682:17)
    at _View._compiledSync.locals [as _compiledSync] (/root/RemoteWorking/node_modules/hexo/lib/theme/view.js:132:24)
    at _View.renderSync (/root/RemoteWorking/node_modules/hexo/lib/theme/view.js:59:25)
    at Object.partial (/root/RemoteWorking/node_modules/hexo/lib/plugins/helper/partial.js:34:15)
    at eval (/root/RemoteWorking/themes/iris/layout/layout.ejs:22:17)
    at layout (/root/RemoteWorking/node_modules/_ejs@2.7.4@ejs/lib/ejs.js:682:17)
    at _View._compiled.locals [as _compiled] (/root/RemoteWorking/node_modules/hexo/lib/theme/view.js:136:50)
    at _View.render (/root/RemoteWorking/node_modules/hexo/lib/theme/view.js:39:17)
    at _compiled.then.result (/root/RemoteWorking/node_modules/hexo/lib/theme/view.js:51:25)
    at tryCatcher (/root/RemoteWorking/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/root/RemoteWorking/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/root/RemoteWorking/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/root/RemoteWorking/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/root/RemoteWorking/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/root/RemoteWorking/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/root/RemoteWorking/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/root/RemoteWorking/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/root/RemoteWorking/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)

@giuem
Copy link
Owner

giuem commented Nov 8, 2020

改一下代码,去除了lodash调用,没有测试,你们看看能运行吗

@XiaoPika
Copy link

XiaoPika commented Nov 8, 2020

测试通过!渲染完成!
按理说 Lodash 调用是 hexo 5 才取消的,不知道为啥hexo 3.8也会报错,哈哈哈不过现在这都不重要了,感谢GIUEM!

@itzhouq
Copy link
Author

itzhouq commented Nov 11, 2020

改一下代码,去除了 lodash 调用,没有测试,你们看看能运行吗

现在可以了,感谢大佬!

@giuem giuem closed this as completed Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants