aframevr / aframe-site

:a: Official A-Frame site.
https://aframe.io/
MIT License
99 stars 143 forks source link

call npm script `installdocs` during `postinstall` #419

Closed cvan closed 7 years ago

cvan commented 7 years ago

fixes this issue with starting the local Hexo server after a clean checkout (and npm install):

> aframe-site@0.0.0 server /opt/aframe-site
> hexo server

[BS] Access URLs:
 ----------------------------------
          UI: http://localhost:3002
 ----------------------------------
 UI External: http://10.0.1.59:3002
 ----------------------------------
INFO  Start processing
INFO  Hexo is running at http://localhost:4000/. Press Ctrl+C to stop.
Unhandled rejection TypeError: /opt/aframe-site/themes/aframe/layout/index.ejs:15
    13|     <ul class="menu">
    14|       <li class="menu-item">
 >> 15|         <a href="<%- url_for(docs_root_path(site.pages, config.aframe_version)) %>">Docs</a>
    16|       </li>
    17|       <li class="menu-item">
    18|         <a href="<%- url_for('faq/') %>">FAQ</a>

Cannot read property 'path' of undefined
    at Object.<anonymous> (/opt/aframe-site/scripts/helpers.js:247:20)
    at Object.wrapper [as docs_root_path] (/opt/aframe-site/node_modules/hexo/node_modules/lodash/lodash.js:4968:19)
    at eval (eval at exports.compile (/opt/aframe-site/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:30:576)
    at eval (eval at exports.compile (/opt/aframe-site/node_modules/ejs/lib/ejs.js:242:14), <anonymous>:30:1853)
    at /opt/aframe-site/node_modules/ejs/lib/ejs.js:255:15
    at Theme._View.View._compiled (/opt/aframe-site/node_modules/hexo/lib/theme/view.js:127:30)
    at Theme._View.View.View.render (/opt/aframe-site/node_modules/hexo/lib/theme/view.js:29:15)
    at /opt/aframe-site/node_modules/hexo/lib/hexo/index.js:387:25
    at tryCatcher (/opt/aframe-site/node_modules/bluebird/js/release/util.js:16:23)
    at /opt/aframe-site/node_modules/bluebird/js/release/method.js:15:34
    at RouteStream._read (/opt/aframe-site/node_modules/hexo/lib/hexo/router.js:134:3)
    at RouteStream.Readable.read (_stream_readable.js:348:10)
    at resume_ (_stream_readable.js:737:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

h/t @ngokevin - thanks

ngokevin commented 7 years ago

Thanks. Was my mistake for removing this step from the README, I added it back: https://github.com/aframevr/aframe-site/commit/78ac1cc1e730cad034c86168b061276dbc3ac93e

Added to README instead of postinstall (as I mistakenly suggested) so you don't have to install docs every time you npm install to upgrade deps.