安装好 Sass 和 Ruby。
通过 Sublime Text 3 的 CTRL + B 编译 Sass 文件出现以下错误:
- [Finished in 0.1s with exit code 1]
- [cmd: ['sass', '--update', 'C:\\Users\\Desktop\\test.sass:C:\\Users\\Desktop/test.css', '--stop-on-error', '--no-cache', '--style', 'compressed']]
- [dir: C:\Users\pc\Desktop]
- [path: C:\Program Files (x86)\Common Files\Intel\Shared Files\cpp\bin\Intel64;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git\cmd;C:\ProgramData\ComposerSetup\bin;D:\lar\php5.6;D:\lar\php5.6\ext;C:\HashiCorp\Vagrant\bin;C:\Program Files\nodejs\;C:\Ruby23\bin;C:\Users\Darlang\AppData\Local\Microsoft\WindowsApps;C:\Users\Darlang\AppData\Roaming\Composer\vendor\bin;C:\Users\Darlang\AppData\Roaming\npm;C:\Users\Darlang\AppData\Local\atom\bin]
大概是这么一堆东西,其实是你的语法错误,造成的。
如果要用以 sass 后缀的文件来编译,则需要用 sass 语法。
具体解释参考这里:
http://www.jianshu.com/p/7f8b5c831774
大多数,我们用的是 scss 的 sass 新语法规则。
所以则需要把 .sass 后缀改为 .scss 后缀
坑了吧。
完毕!
参考:
https://www.zhihu.com/question/48702869
http://stackoverflow.com/questions/7745855/sass-invalid-css-error-expected-expression
http://stackoverflow.com/questions/38728558/sass-invalid-css-expected-expression-e-g-1px-bold-was
https://github.com/jaumefontal/SASS-Build-SublimeText2
评论 (0)