Closed xiaoyuebao closed 2 years ago
删除 themes 文件夹试试。
试了试不行
hexo是装的6.0.0
请提供可复现示例。
这是问题项目地址https://github.com/xiaoyuebao/blog.git
你这没装主题啊……
是这样的,我先执行npm install hexo-theme-yun@latest,运行起来以后打开是这样的
node_modules里也有yun主题文件夹
,
所以我就执行了npm install hexo-render-pug hexo-renderer-stylus
然后node_modules里yun主题文件夹就没了,然后多了个hexo-render-pug
,
然后就出现了我说的no layout问题,但是当我再次安装yun主题,hexo-render-pug就没了,打开页面还是
整个流程陷入了死循环,但不管我执行哪个命令,package.json里都没有新增内容,难道要手动在package.json添加吗
刚试了试在package.json里手动添加了 "hexo-render-pug": "^2.1.4", "hexo-theme-yun": "1.8.11",然后重新install了一下就好了
刚才我有重新走了下流程,发现安装hexo-theme-yun就会把node_modules里的hexo-render-pug删掉,安装hexo-render-pug就会把node_modules里的hexo-theme-yun删掉,而且都不会在package.json里增加依赖,只能手动增加依赖,然后npm i才行,这是啥问题,难道是我npm的问题?
……我觉得是你 npm 安装方式有问题,包本身是做不到卸载其他包这件事情的。
而且我一下执行npm install hexo-theme-yun hexo-render-pug hexo-renderer-stylus,node_modules里pug、stylus、yun依赖倒是都有了,但还是显示缺pug
只有手动在package.json里添加pug、yun依赖,然后install的才没有问题
我在Linux子系统上跑了一遍没有这个问题
我在Linux子系统上跑了一遍没有这个问题,可能是我系统或者npm 或者hexo的问题,
我又在别人电脑上跑了一遍,也没有问题,原来真是我电脑的问题,吐了
(重装保平安)
按照文档步骤安装 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方式的,请问这个问题怎么解决