chiyuki0325 / hexo-theme-stellaris

📑 Powerful, elegant and modern Hexo theme, forked from hexo-theme-stellar.
MIT License
78 stars 9 forks source link

HEXO G和Hexo s失败☹️ #8

Open mcxen opened 7 months ago

mcxen commented 7 months ago

大佬您好

这个安照步骤安装好主题后,无法启动,报错如下

截屏2024-04-08 19 47 28
ERROR 
Error: /Users/mcxw/Downloads/mcxenblog/node_modules/hexo-theme-stellaris/layout/index.styl:1:9
   1| @import 'partial/*'
--------------^
   2| @import 'tag-plugins/*'
   3| @import 'sidebar/*'
   4| @import 'widgets/*'

failed to locate @import file partial/*.styl

    at Evaluator.visitImport (/Users/mcxw/Downloads/mcxenblog/node_modules/stylus/lib/visitor/evaluator.js:911:23)
    at Evaluator.visit (/Users/mcxw/Downloads/mcxenblog/node_modules/stylus/lib/visitor/index.js:29:42)
    at Evaluator.visit (/Users/mcxw/Downloads/mcxenblog/node_modules/stylus/lib/visitor/evaluator.js:154:20)
    at Evaluator.visitRoot (/Users/mcxw/Downloads/mcxenblog/node_modules/stylus/lib/visitor/evaluator.js:703:29)
    at Evaluator.visit (/Users/mcxw/Downloads/mcxenblog/node_modules/stylus/lib/visitor/index.js:29:42)
    at Evaluator.visit (/Users/mcxw/Downloads/mcxenblog/node_modules/stylus/lib/visitor/evaluator.js:154:20)
    at Evaluator.evaluate (/Users/mcxw/Downloads/mcxenblog/node_modules/stylus/lib/visitor/evaluator.js:241:17)
    at Renderer.render (/Users/mcxw/Downloads/mcxenblog/node_modules/stylus/lib/renderer.js:70:28)
    at Hexo.stylusFn (/Users/mcxw/Downloads/mcxenblog/node_modules/hexo-renderer-stylus/lib/renderer.js:62:6)
    at Hexo.promisified (/Users/mcxw/Downloads/mcxenblog/node_modules/bluebird/js/release/promisify.js:223:16)
    at /Users/mcxw/Downloads/mcxenblog/node_modules/hexo/dist/hexo/render.js:73:28
    at tryCatcher (/Users/mcxw/Downloads/mcxenblog/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/mcxw/Downloads/mcxenblog/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/Users/mcxw/Downloads/mcxenblog/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromiseCtx (/Users/mcxw/Downloads/mcxenblog/node_modules/bluebird/js/release/promise.js:641:10)
    at _drainQueueStep (/Users/mcxw/Downloads/mcxenblog/node_modules/bluebird/js/release/async.js:97:12)
    at _drainQueue (/Users/mcxw/Downloads/mcxenblog/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/Users/mcxw/Downloads/mcxenblog/node_modules/bluebird/js/release/async.js:102:5)
    at Async.drainQueues [as _onImmediate] (/Users/mcxw/Downloads/mcxenblog/node_modules/bluebird/js/release/async.js:15:14)
    at process.processImmediate (node:internal/timers:478:21)
chiyuki0325 commented 7 months ago

目前主题对子目录的支持不完善,请在博客根目录运行 hexo 相关命令。 另外我并没有任何苹果设备,因此如果这个问题只在 macOS 上出现,我不会解决,请见谅。

taranakineko commented 6 months ago

看了一眼,发现因为不知道什么奇妙的原因会导致使用 npm 方式安装后执行 hexo g 时报错 这边建议使用 npm uninstall hexo-theme-stellaris 卸载主题后按照 使用 Git 安装 一节进行安装

安装后直接执行 hexo g 依然会报错,请按照 文档 一节,在博客根目录下新建 _config.stellaris.yaml 并填写相应配置后重新执行 hexo g 大概率就不会报错了


备注:主题目前尚未对 Hexo 7 进行测试,如果遇到一些其他的奇妙问题可以尝试降级 Hexo 版本至 6.3.0 再尝试复现

wangziling commented 6 months ago

建议使用 git submodule 的方式引入。

我也试了的 npm install 的方法,也是同样的报错。尝试了各种办法都不得行,挺奇怪的,暂时想不到咋出的问题。

hexo v7 的话,你可以引用我的Fork版 https://github.com/wangziling/hexo-theme-stellarismain 分支。

太久没搞 hexo 的东西了,不太清楚 v6 和 v7 之间有没有 breaking changes。所以我单独在我的 fork 版里面基于作者main分支最新的代码拉了一个新的 v6 的分支,用来提 PR

引入 submodule 后,得先安装一些依赖:

# 替换成你自己用的包管理器,我用的 pnpm。
pnpm add @babel/plugin-transform-react-jsx moize html-react-parser moment react react-dom hexo-renderer-jsx hexo-fs

然后就可以了。

wangziling commented 6 months ago

Hi @mcxen~ 根据 fork 来源的改动:https://github.com/xaoxuu/hexo-theme-stellar/commit/53e37f4406971d5de2b55b1808da47f98534f421

应该是这个问题:https://github.com/xaoxuu/hexo-theme-stellar/issues/372#issuecomment-2080420694