简体   繁体   English

内部错误:无效的UTF-8 - Sass&Gulp

[英]Internal Error: Invalid UTF-8 - Sass & Gulp

I get the following error when trying to run gulp sass in Linux Ubuntu 尝试在Linux Ubuntu中运行gulp sass时出现以下错误

hutber@hutber-ubuntu:/var/www/beta.norsemanfc.co.uk$ gulp sass
[14:43:26] Using gulpfile /var/www/beta.norsemanfc.co.uk/gulpfile.js
[14:43:26] Starting 'sass'...
[14:43:27] gulp-notify: [Compile Error] frontend/sass/style.scss
Internal Error: Invalid UTF-8

[14:43:27] Finished 'sass' after 547 ms

Searching through all the files/folders for any special characters returns nothing. 在所有文件/文件夹中搜索任何特殊字符都不会返回任何内容。

hutber@hutber-ubuntu:/var/www/beta.norsemanfc.co.uk$ find ./* -iregex '.*/.*[èö].*' -print

Otherwise if I remove the @import at the start of the file it will then fail on the @include border-box-sizing; 否则,如果我在文件的开头删除@import,它将在@include border-box-sizing上失败; as this is a variable from susy 因为这是来自susy的变量

So of course how can I get sass running locally? 那么我当然如何在本地运行sass?

updated 更新

hutber@hutber-ubuntu:/var/www/beta.norsemanfc.co.uk/frontend/sass$ find ./* | xargs grep -i '.*/.*[èö].*'
grep: ./fonts: Is a directory
grep: ./fonts/helvetica-neue: Is a directory
grep: ./modules: Is a directory
grep: ./modules/form: Is a directory
grep: ./pages: Is a directory
grep: ./plugins: Is a directory
grep: ./susy: Is a directory
grep: ./susy/susy: Is a directory
grep: ./susy/susy/language: Is a directory
grep: ./susy/susy/language/susy: Is a directory
grep: ./susy/susy/language/susyone: Is a directory
grep: ./susy/susy/su: Is a directory
grep: ./susy/susy/output: Is a directory
grep: ./susy/susy/output/support: Is a directory
grep: ./susy/susy/output/float: Is a directory
grep: ./susy/susy/output/shared: Is a directory

NB: Similar Question: Error "Invalid UTF-8" when compiling sass with @import This is fixed by removing special charaters from the path, however all my folders are english and always have been. 注意:类似的问题: 使用@import编译sass时出现错误“无效的UTF-8”这是通过从路径中删除特殊字符来修复的,但是我的所有文件夹都是英文的,并且一直都是。

You can try converting the file to ASCII and see if ? 您可以尝试将文件转换为ASCII并查看是否? marks appears, those are the non UTF-8 ones: 标记出现,那些是非UTF-8:

cat your-file.css | iconv -f utf-8 -t ascii//TRANSLIT > ascii.css

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM