无法在 Webstorm 中运行 SASS [英] Unable to run SASS in Webstorm

查看:75
本文介绍了无法在 Webstorm 中运行 SASS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚使用 Ruby Gems 安装了 Sass,尽管我的项目在 Webstorm 的 NodeJS 中.在 Webstorm 中启用 SASS 文件观察器.当我从命令行运行sass style.scss"时,我得到一个 .sass-cache 文件夹,但不是实际编译的 CSS 文件.Webstorm 在我的 SASS 文件中没有显示任何错误.我需要将该文件编译为 .css 文件.

I just installed Sass using Ruby Gems, although my project is in NodeJS in Webstorm. To enable the SASS file watcher in Webstorm. When I run "sass styles.scss" from the commandline, I get a .sass-cache folder but not the actual compiled CSS file. Webstorm does not show any errors in my SASS file. I need the file to compile to a .css file.

我还尝试在未编译 scss 文件的 Webstorm 中设置文件观察器.我在 Webstorm 的文件观察器中的 SCSS 可执行路径是这样的.C:\Ruby200-x64\bin\sass.bat.

I am also trying to setup a filewatcher in Webstorm that is not compiling the scss file. My SCSS executable path in the filewatcher in Webstorm is this. C:\Ruby200-x64\bin\sass.bat.

这是文件观察器设置.

Webstorm在控制台显示的错误,当.scss文件被保存时(这是文件观察器应该被触发的时候),是这样的:

The error Webstorm shows in the console, when the .scss file is saved is (which is when the file watcher should be triggered), is this:

C:/Ruby200-x64/bin/sass.bat --no-cache --update styles.scss:styles.css
'"ruby.exe"' is not recognized as an internal or external command,
operable program or batch file.

无法在上图中完全看到的文件观察器的完整参数是:

The full argument to the file watcher that cant be entirely seen in the image above is this:

--no-cache --update $FileName$:$FileNameWithoutExtension$.css

推荐答案

这里是:

没有数数而是从上到下,

Didn't numerate but from top to bottom,

  1. 选择你的观察者,你可以针对各种情况进行预设(也许可以尝试制作一个新的)
  2. 我的 32 位 sass.bat 的路径(不是 100% 确定,但我认为即使 scss.bat 也能工作)
  3. 输出,您可以在下面的屏幕截图中看到它应该如何工作/外观.

这篇关于无法在 Webstorm 中运行 SASS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆