tufu9441 / maupassant-hexo

A simple Hexo theme forked from icylogic.
https://www.haomwei.com
MIT License
2.61k stars 670 forks source link

node-sass 新解法 #517

Open johanazhu opened 2 years ago

johanazhu commented 2 years ago

hexo-renderer-sass 这个库3年前就停更了,所以对 node-sass 的解决方案是将 node 降级到15以下(因为 node-sass 要与 node 版本匹配,而 hexo-renderer-sass 使用的库是v4.14.1,所以要降级到15以下)

目前因为其他库要将 node 升级15以上,所以就形成冲突,我的解决办法是进入node_module 的 hexo-renderer-hexo 中,将这个库的 node-sass 升级至 6.0.1,然后就能解析了

还有一种想到的方法,因为 hexo-renderer-sass 代码很简单,可以直接拷贝库重新做个 hexo-renderer-sass2 库,将 node-sass 更新也可以

tufu9441 commented 2 years ago

感谢你的分享!我前段时间更新Nodejs和Hexo的时候也发现了,于是将Nodejs降级到了v14.18.3后便不再报错了。你说的最后一种方法,我在网上看到已经有人做了尝试,并fork了hexo-renderer-sass的库,见:https://github.com/cocowool/hexo-renderer-sass

johanazhu commented 2 years ago

cool

domeniczz commented 1 year ago

感谢你的分享!我前段时间更新Nodejs和Hexo的时候也发现了,于是将Nodejs降级到了v14.18.3后便不再报错了。你说的最后一种方法,我在网上看到已经有人做了尝试,并fork了hexo-renderer-sass的库,见:https://github.com/cocowool/hexo-renderer-sass

我尝试安装,但是不行诶

以下两种都尝试了,第一种就是 deprecated 无法安装,第二种就是卡住不动无法安装

我用 nvm,切换了 node 12.18.1 和 node 16.15.0,都无法成功

npm install --save hexo-renderer-sass

npm install --save-dev hhttps://github.com/cocowool/hexo-renderer-sass.git
cirry commented 1 year ago

npm install hexo-renderer-sass-next --save 即可

cdnf commented 2 months ago

这个早就有替代方案了:解决 hexo-renderer-sass 无法安装