Search code examples
sass

sass : The term 'sass' is not recognized as the name of a cmdlet, function, script file, or operable program


I'm trying to get sass to run through the terminal and when I try, I get the error mentioned above. It seems that the installation of sass itself was successful because I can see it in my package.json file:

 "devDependencies": {
    "sass": "^1.51.0"
  }

I have tried uninstalling/reinstalling sass, and restarting the client, but can't get the 'sass' keyword to work. I currently have my project located in a folder that github is also directed at so I can make pushing updates to github easier. Any help would be greatly appreciated.


Solution

  • Try npx sass, or create a new entry in the scripts section of your {package,yarn}.json file that calls sass.

    "scripts": {
      "build": "sass input.scss output.css",
    }
    

    Then, npm run build or yarn build, depending on which package manager you are using.

    https://sass-lang.com/documentation/cli/dart-sass