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

启动访问的时候报错,需要依赖已经按照文档安装了 #527

Open
xvpenghao opened this issue Jan 22, 2021 · 1 comment
Open

Comments

@xvpenghao
Copy link

ERROR {
  err: ReferenceError: /Users/xph/xvpenghao.github.io/themes/indigo/layout/layout.ejs:5
      3|   <%- partial('_partial/loading') %>
      4|   <nav id="menu" <% if(is_post() && theme.hideMenu){ %>class="hide"<% } %> >
   >> 5|    <%- partial('_partial/menu') %>
      6|   </nav>
      7|   <main id="main">
      8|     <%- partial('_partial/header') %>

  /Users/xph/xvpenghao.github.io/themes/indigo/layout/_partial/menu.ejs:27
      25|             <a href="<%- url_for(menuItem.url) %>" <% if(menuItem.target){ %>target="_blank"<% } %> >
      26|               <i class="icon icon-lg icon-<%= i %>"></i>
   >> 27|               <%=(menuItem.text || _.startCase(i)) %>
      28|             </a>
      29|           </li>
      30|       <% } %>

  _ is not defined
      at eval (/Users/xph/xvpenghao.github.io/themes/indigo/layout/_partial/menu.ejs:49:43)
      at menu (/Users/xph/xvpenghao.github.io/node_modules/ejs/lib/ejs.js:682:17)
      at _View._compiledSync (/Users/xph/xvpenghao.github.io/node_modules/hexo/lib/theme/view.js:132:24)
      at _View.renderSync (/Users/xph/xvpenghao.github.io/node_modules/hexo/lib/theme/view.js:59:25)
      at Object.partial (/Users/xph/xvpenghao.github.io/node_modules/hexo/lib/plugins/helper/partial.js:34:15)
      at eval (/Users/xph/xvpenghao.github.io/themes/indigo/layout/layout.ejs:21:17)
      at layout (/Users/xph/xvpenghao.github.io/node_modules/ejs/lib/ejs.js:682:17)
      at _View._compiled (/Users/xph/xvpenghao.github.io/node_modules/hexo/lib/theme/view.js:136:50)
      at _View.render (/Users/xph/xvpenghao.github.io/node_modules/hexo/lib/theme/view.js:39:17)
      at /Users/xph/xvpenghao.github.io/node_modules/hexo/lib/theme/view.js:51:25
      at tryCatcher (/Users/xph/xvpenghao.github.io/node_modules/bluebird/js/release/util.js:16:23)
      at Promise._settlePromiseFromHandler (/Users/xph/xvpenghao.github.io/node_modules/bluebird/js/release/promise.js:547:31)
      at Promise._settlePromise (/Users/xph/xvpenghao.github.io/node_modules/bluebird/js/release/promise.js:604:18)
      at Promise._settlePromise0 (/Users/xph/xvpenghao.github.io/node_modules/bluebird/js/release/promise.js:649:10)
      at Promise._settlePromises (/Users/xph/xvpenghao.github.io/node_modules/bluebird/js/release/promise.js:729:18)
      at _drainQueueStep (/Users/xph/xvpenghao.github.io/node_modules/bluebird/js/release/async.js:93:12)
      at _drainQueue (/Users/xph/xvpenghao.github.io/node_modules/bluebird/js/release/async.js:86:9)
      at Async._drainQueues (/Users/xph/xvpenghao.github.io/node_modules/bluebird/js/release/async.js:102:5)
      at Immediate.Async.drainQueues [as _onImmediate] (/Users/xph/xvpenghao.github.io/node_modules/bluebird/js/release/async.js:15:14)
      at processImmediate (internal/timers.js:461:21) {
    path: '/Users/xph/xvpenghao.github.io/themes/indigo/layout/layout.ejs'
  }
} Render HTML failed: index.html
Unhandled rejection ReferenceError: /Users/xph/xvpenghao.github.io/themes/indigo/layout/layout.ejs:5
    3|   <%- partial('_partial/loading') %>
    4|   <nav id="menu" <% if(is_post() && theme.hideMenu){ %>class="hide"<% } %> >
 >> 5|    <%- partial('_partial/menu') %>
    6|   </nav>
    7|   <main id="main">
    8|     <%- partial('_partial/header') %>

/Users/xph/xvpenghao.github.io/themes/indigo/layout/_partial/menu.ejs:27
    25|             <a href="<%- url_for(menuItem.url) %>" <% if(menuItem.target){ %>target="_blank"<% } %> >
    26|               <i class="icon icon-lg icon-<%= i %>"></i>
 >> 27|               <%=(menuItem.text || _.startCase(i)) %>
    28|             </a>
    29|           </li>
    30|       <% } %>

_ is not defined
    at eval (/Users/xph/xvpenghao.github.io/themes/indigo/layout/_partial/menu.ejs:49:43)
    at menu (/Users/xph/xvpenghao.github.io/node_modules/ejs/lib/ejs.js:682:17)
    at _View._compiledSync (/Users/xph/xvpenghao.github.io/node_modules/hexo/lib/theme/view.js:132:24)
    at _View.renderSync (/Users/xph/xvpenghao.github.io/node_modules/hexo/lib/theme/view.js:59:25)
    at Object.partial (/Users/xph/xvpenghao.github.io/node_modules/hexo/lib/plugins/helper/partial.js:34:15)
    at eval (/Users/xph/xvpenghao.github.io/themes/indigo/layout/layout.ejs:21:17)
    at layout (/Users/xph/xvpenghao.github.io/node_modules/ejs/lib/ejs.js:682:17)
    at _View._compiled (/Users/xph/xvpenghao.github.io/node_modules/hexo/lib/theme/view.js:136:50)
    at _View.render (/Users/xph/xvpenghao.github.io/node_modules/hexo/lib/theme/view.js:39:17)
    at /Users/xph/xvpenghao.github.io/node_modules/hexo/lib/theme/view.js:51:25
    at tryCatcher (/Users/xph/xvpenghao.github.io/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/xph/xvpenghao.github.io/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/Users/xph/xvpenghao.github.io/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/Users/xph/xvpenghao.github.io/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/Users/xph/xvpenghao.github.io/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/Users/xph/xvpenghao.github.io/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/Users/xph/xvpenghao.github.io/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/Users/xph/xvpenghao.github.io/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/Users/xph/xvpenghao.github.io/node_modules/bluebird/js/release/async.js:15:14)
    at processImmediate (internal/timers.js:461:21)
@lyh543
Copy link

lyh543 commented Jun 30, 2021

别用 hexo 5,用 hexo 4

npm uninstall hexo --save
npm install hexo@^4.0.0 --save

hexo 5 不再把 _ 作为全局变量:https://hexo.io/docs/variables#Global-Variables

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

2 participants