错误:C.UTF-8:不是有效的语言标记 [英] uncss Error: C.UTF-8: not a valid language tag
问题描述
我正尝试使用 UNCSS 首次从CSS删除未使用的样式,我是出现以下错误:
Hi I am trying to use UNCSS to remove unused styles from CSS for the first time and I am getting the following error:
Fontconfig警告:忽略C.UTF-8:不是有效的语言标记
Fontconfig warning: ignoring C.UTF-8: not a valid language tag
/home/ubuntu/.nvm/v0.10.35/lib/node_modules/uncss/node_modules/bluebird/js/main/async.js:43 fn = function(){throw arg; }; ^错误:Fontconfig警告:忽略C.UTF-8:不是有效的语言标记
/home/ubuntu/.nvm/v0.10.35/lib/node_modules/uncss/node_modules/bluebird/js/main/async.js:43 fn = function () { throw arg; }; ^ Error: Fontconfig warning: ignoring C.UTF-8: not a valid language tag
at Socket.onStderr (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/uncss/node_modules/phridge/lib/spawn.js:79:28)
at Socket.emit (events.js:117:20)
at Socket.<anonymous> (_stream_readable.js:765:14)
at Socket.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:427:10)
at emitReadable (_stream_readable.js:423:5)
at readableAddChunk (_stream_readable.js:166:9)
at Socket.Readable.push (_stream_readable.js:128:10)
at Pipe.onread (net.js:529:21)
我什至尝试使用Gulp,而且我一直在寻找解决方案,但我不理解要解决的输出.
I even tried using Gulp and I have been searching for a solution and I am not understanding the output to fix it.
任何解决此问题的帮助将不胜感激.
Any help to resolve this will be greatly appreciated.
-j
推荐答案
这是由于fontconfig中的错误所致.该错误据说已于2013年修复,因此不太可能从这一方面获得帮助.
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.
但是,您只能更改为其他语言环境而不是C.UTF-8:
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
如果您还没有:
$ npm install -g uncss
现在一切正常:
$ uncss http://yoururl.com > style.css
这篇关于错误:C.UTF-8:不是有效的语言标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!