3

I installed Sass via Chocolatey and get this error in the Netbeans console:

"C:\ProgramData\chocolatey\lib\sass\tools\sass.bat" "--cache-location" "C:\Users\oxk4r\AppData\Local\NetBeans\Cache\8.2\sass-compiler" "--debug-info" "--style" "compact" "C:\xampp\htdocs\SASS_01\scss\style.scss" "C:\xampp\htdocs\SASS_01\css\style.css" Could not find an option named "cache-location".

No *.css file is generated at all.

oxk4r
  • 452
  • 6
  • 17

4 Answers4

10

In your Sass install directory, in file sass.bat, after the command:

set arguments=%*

add the following (replace username with your windows username)...

set arguments=%arguments:--cache-location =%
set arguments=%arguments:C:\Users\username\AppData\Local\NetBeans\Cache\8.2\sass-compiler =%
set arguments=%arguments:--debug-info =%

This strips out all of the arguments that are no longer accepted.

joeComponent
  • 186
  • 11
  • Also resolves the problem if you installed Sass using the standalone version. – Jan Jun 05 '19 at 13:23
  • I keep coming back to this answer time after time. Thank you. – Ryan Mar 28 '20 at 15:22
  • Also change the folder name that is the Netbeans version number after Cache if you install new version of Netbeans – Rob Nov 13 '20 at 12:14
4

I copy here the answer of Pete Whelpton at Apache Netbeans bug tracking for future reference because it is very useful for this issue:

https://issues.apache.org/jira/browse/NETBEANS-2347

Netbeans SASS support was written for the original Ruby SASS. Modern SASS implementations (Dart SASS et al) are based on libsass.

There is very limited/incomplete support for libsass already in Netbeans (command line flags are NOT supported - but it should compile). To implement the workaround:

  1. Open your netbeans.conf file (/etc/netbeans.conf in the NB installation folder)
  2. Add the following to the netbeans_default_options parameter: -J-Dnb.sass.libsass=true
  3. Launch Netbeans, Tools -> Options -> HTML5/JS -> CSS PreProcessors and configure it to point to your libsass implementation (e.g. the sass.bat file in your dart-sass installation folder)

In my case (Apache Netbeans Windows 64) this workaround worked.

Hokusai
  • 2,219
  • 1
  • 21
  • 22
1

for Windows you may to edit sass.bat file.

In file need in variable arguments to replace a substring "--debug-info" and (for example) "--cache-location C:\Users\xyz\AppData\Local\NetBeans\Cache\10.0\sass-compiler" on empty data

for example: SET repaire_arguments=%arguments:--debug-info=% SET repaire_arguments=%repaire_arguments:--cache-location C:\Users\xyz\AppData\Local\NetBeans\Cache\10.0\sass-compiler=% "%SCRIPTPATH%\src\dart.exe" "-Dversion=1.16.1" "%SCRIPTPATH%\src\sass.dart.snapshot" %repaire_arguments%

Oleg Kyryliv
  • 111
  • 3
0

When I had that error my installation wasn't working correctly. I didn't use Chocolatey though. I installed ruby and sass with gem, added the path in the config and got it working. Maybe that helps.

semelina
  • 1
  • 1