uncss Error: C.UTF-8: not a valid language tag

僤鯓⒐⒋嵵緔 提交于 2019-12-06 14:18:44

This is due to a bug in fontconfig. The bug is claimed to be fixed in 2013 so it is unlikely to get help from this side.

However you can just change to a different locale instead of C.UTF-8:

$ sudo locale-gen en_US en_US.UTF-8
$ sudo dpkg-reconfigure locales
$ sudo update-locale LANG=en_US

You can check if everything worked with the command:

$ locale

LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8

In case you already did not:

$ npm install -g uncss

Now everything should work:

$ uncss http://yoururl.com > style.css
LC_ALL=en_US.utf8

I had the same error. Typing this single line resolved the error.

I found en_US.utf8 in my list of locales locale -a as explained there: https://help.ubuntu.com/community/Locale

(This is a temporarily change, not permanent)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!