YunYouJun / hexo-theme-yun

☁️ A fast & light & lovely theme for Hexo. 一个对可爱自以为是的 Hexo 主题。
https://yun.yunyoujun.cn
MIT License
1.39k stars 168 forks source link

按照文档安装完以后运行报错 #275

Closed xiaoyuebao closed 2 years ago

xiaoyuebao commented 2 years ago

按照文档步骤安装 npm install hexo-theme-yun@latest npm install hexo-render-pug hexo-renderer-stylus _config.yml 主题 也改了,但是运行起来以后显示空白页,控制台报WARN No layout: index.html, 用以前的clone方法就没问题,但是npm方式不行,百度出来的都是clone方式,没有npm方式的,请问这个问题怎么解决

YunYouJun commented 2 years ago

删除 themes 文件夹试试。

xiaoyuebao commented 2 years ago

试了试不行

xiaoyuebao commented 2 years ago

hexo是装的6.0.0

YunYouJun commented 2 years ago

请提供可复现示例。

xiaoyuebao commented 2 years ago

这是问题项目地址https://github.com/xiaoyuebao/blog.git image

YunYouJun commented 2 years ago

96AF4DAB534F7BCF9ED12D9F1DE386F6

你这没装主题啊……

image
xiaoyuebao commented 2 years ago

是这样的,我先执行npm install hexo-theme-yun@latest,运行起来以后打开是这样的 image node_modules里也有yun主题文件夹 image, 所以我就执行了npm install hexo-render-pug hexo-renderer-stylus 然后node_modules里yun主题文件夹就没了,然后多了个hexo-render-pug image, 然后就出现了我说的no layout问题,但是当我再次安装yun主题,hexo-render-pug就没了,打开页面还是 image image 整个流程陷入了死循环,但不管我执行哪个命令,package.json里都没有新增内容,难道要手动在package.json添加吗

xiaoyuebao commented 2 years ago

刚试了试在package.json里手动添加了 "hexo-render-pug": "^2.1.4", "hexo-theme-yun": "1.8.11",然后重新install了一下就好了 image

xiaoyuebao commented 2 years ago

刚才我有重新走了下流程,发现安装hexo-theme-yun就会把node_modules里的hexo-render-pug删掉,安装hexo-render-pug就会把node_modules里的hexo-theme-yun删掉,而且都不会在package.json里增加依赖,只能手动增加依赖,然后npm i才行,这是啥问题,难道是我npm的问题?

YunYouJun commented 2 years ago

……我觉得是你 npm 安装方式有问题,包本身是做不到卸载其他包这件事情的。

xiaoyuebao commented 2 years ago

而且我一下执行npm install hexo-theme-yun hexo-render-pug hexo-renderer-stylus,node_modules里pug、stylus、yun依赖倒是都有了,但还是显示缺pug image image 只有手动在package.json里添加pug、yun依赖,然后install的才没有问题

YunYouJun commented 2 years ago

96AF4DAB534F7BCF9ED12D9F1DE386F6

先用着吧,之后会把主题迁移到 valaxy,这些小毛病都解决了。 不需要再安装渲染器了。

xiaoyuebao commented 2 years ago

我在Linux子系统上跑了一遍没有这个问题

xiaoyuebao commented 2 years ago

我在Linux子系统上跑了一遍没有这个问题,可能是我系统或者npm 或者hexo的问题,

xiaoyuebao commented 2 years ago

我又在别人电脑上跑了一遍,也没有问题,原来真是我电脑的问题,吐了

YunYouJun commented 2 years ago

(重装保平安)