Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on windows when trying to compile scss file with npm sass version. #41

Open
fabman opened this issue Feb 28, 2022 · 0 comments
Open

Comments

@fabman
Copy link

fabman commented Feb 28, 2022

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?.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant