bennyxguo / hexo-theme-obsidian

🎨 A dark Hexo theme, it's responsive, simple but elegant.
https://obsidian.tridiamond.tech/
MIT License
781 stars 108 forks source link

关于访问首页出现空白页面问题 #97

Closed mkdir700 closed 4 years ago

mkdir700 commented 4 years ago

访问首页发现是空白的情况,可以查看仓库根目录下,应该会有一个index.html文件

打开这个文件不出意外是空白的,静态文件生成了,但是没有内容。

hexo g --debug

会看到类似的报错信息

ERROR Script load failed: themes/obsidian/scripts/libs/cheerio/static.js
Error: Cannot find module 'css-what'
Require stack:
- /www/wwwroot/myblog/node_modules/css-select/lib/compile.js
- /www/wwwroot/myblog/node_modules/css-select/index.js
- /www/wwwroot/myblog/themes/obsidian/scripts/libs/cheerio/static.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
    at Function.Module._load (internal/modules/cjs/loader.js:842:27)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/www/wwwroot/myblog/node_modules/css-select/lib/compile.js:9:19)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/www/wwwroot/myblog/node_modules/css-select/index.js:12:21)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (/www/wwwroot/myblog/node_modules/hexo/lib/hexo/index.js:280:23)
    at /www/wwwroot/myblog/themes/obsidian/scripts/libs/cheerio/static.js:6:14
    at /www/wwwroot/myblog/node_modules/hexo/lib/hexo/index.js:293:14
    at tryCatcher (/www/wwwroot/myblog/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/www/wwwroot/myblog/node_modules/bluebird/js/release/promise.js:547:31)

简而言之,就是模块缺失,作者给出了package.json

所以解决办法:

cd themes/obsidian/
npm install

40 这里也提到了此问题,手动安装一次就好了

bennyxguo commented 4 years ago

我在说明文档中补充了这个步骤了。谢谢支持!