Error on windows when trying to compile scss file with npm sass version.
fabman opened this issue · 0 comments
On windows, after installing sass npm version with:
npm install -g sass
As explained on the official page
When I try to to compile the file E:\scss-mode\style.scss
gives the error:
-*- mode: compilation; default-directory: "e:/scss-mode/" -*-
Compilation started at Mon Feb 28 23:55:47
sass --update 'e:/scss-mode/'
Error reading 'e: no such file or directory.
Compilation exited abnormally with code 66 at Mon Feb 28 23:55:48
After testing the problem outside Emacs from the command line the problem appears to be the use of single quotes for the absolute path with the npm version of sass on windows. It seems that replacing on scss-mode.el
the "'"
for "\""
the problem disappears in windows ( and it doesn't give any problem on Linux but I haven't fully tested in other systems ).
After replacing the scss-compile()
function with this code:
(defun scss-compile()
"Compiles the directory belonging to the current buffer, using the --update option"
(interactive)
(compile (concat scss-sass-command " " (mapconcat 'identity scss-sass-options " ") " --update "
(when (string-match ".*/" buffer-file-name)
(concat "\"" (match-string 0 buffer-file-name) "\""))
(when scss-output-directory
(concat ":\"" scss-output-directory "\"")))))
Everything seems to work perfectly ( on windows ):
-*- mode: compilation; default-directory: "e:/scss-mode/" -*-
Compilation started at Tue Mar 1 00:03:29
sass --update "e:/scss-mode/"
Compiled style.scss to style.css.
Compilation finished at Tue Mar 1 00:03:30
Does this really solves the problem or will this create any other problem in the future?.