WebCompiler icon indicating copy to clipboard operation
WebCompiler copied to clipboard

sass.cmd is not recognized as an internal or external command

Open benehudson opened this issue 1 year ago • 5 comments

Installed product versions

  • Visual Studio: VS 2022 (v 17.5.4)
  • This extension: 1.14.11

Description

I'm getting this error when a *.scss file attempts to compile. "Error '"C:\Temp\WebCompiler1.14.11\node_modules.bin\sass.cmd"' is not recognized as an internal or external command, operable program or batch file. REDACTED C:\Users\redacted...\wwwroot\css\template.scss 0

I have attempted to un-install/re-install twice.

Steps to recreate

  1. Save change to template.scss or right-click and re-compile file.

Current behavior

I get the error message in Description above.

Expected behavior

The file should compile and generate template.css and template.min.css

benehudson avatar May 08 '23 15:05 benehudson

I also did npm install -g sass I'm still getting the same error

benehudson avatar May 08 '23 20:05 benehudson

Can you the following:

  1. Uninstall the Extension,
  2. Delete the Directory C:\Temp\WebCompiler1.14.11\
  3. Install the Extension

Let me know if that works.

failwyn avatar May 15 '23 10:05 failwyn

@failwyn thanks for your reply. I actually got this sorted last week. I thought I posted the fix here. When the install completed there was a NODE_MODULES.cmd (the file name was something like that...it disappeared after it ran) file in the C:\Temp\WebCompiler1.14.11\ I ran that *.cmd and it put the necessary dependencies in the .bin folder. That resolved my issue.

benehudson avatar May 15 '23 13:05 benehudson

Glad to hear it; it seems like there is a permissions issue that causes this to happen, do you run Visual Studio as Administrator?

failwyn avatar May 15 '23 20:05 failwyn

I'm a local admin on the machine where Visual Studio ran, but I did/do not right-click VS and choose run as admin.

benehudson avatar May 16 '23 15:05 benehudson