念一叨 Nyaggin'

本来今天开开心心维护着博客,随手升级了一下 Node 结果再编译的时候 node-sass 这个包抱怨最高只兼容到 v16,于是打算回滚重新安装一波依赖。 rm -rfnode_modules 之后 npm i 居然报错了:

I was maintaining this blog website as usual, and I noticed that there was an new release of Node, so I upgraded it, then the package node-sass started complaining that it is not compatible with ^v16. I was left no choice but to roll back. After I deleted the node_modules directory and was trying to reinstall every dependency with npm i, the following errors popped out:

哇这一屏红字看着都头疼……

去搜了一下报错信息里出现最多的 gyp,发现是这么个玩意:

Ain't it just painful to watch…

I googled for that gyp term, and it turns out to be this:

看上去很美好的构想,然而:

That seems to be a beautiful ideal, however:

Further investigation shows that 这玩意是 node-sass 的依赖项。 尼玛,我刚把 SCSS 用趁手啊! 没办法,只好去找别的替代品。 看到两个选项,Less 和 Stylus,我选了后一个,体验不错。 语法和 SASS 大差不差,和 SCSS 也基本兼容,只是有些变量的定义需要手动转写一下。

结论:别用 SASS。

Further investigation shows that it's a dependency of node-sass. Fuck that I have just gotten along well with SCSS! But a crap is a crap, I'll have to solve it. So I went to look for SASS alternatives. Internet gave me two options: Less & Stylus, and I went for the latter. Turns out it worked out great: its grammar is pretty similar to SASS, and overall is compatible with SCSS, just that I'll have to rewrite some variable definitions.

Conclusion: Don't use SASS.