Home > Software design >  Trying a scss file to css by using terminal, sass doesn't work
Trying a scss file to css by using terminal, sass doesn't work

Time:12-11

i'm learning html and i'm in the very beginning. i've written this variables.scss file and trying to turn css file. this is what i wrote to VS Code terminal: sass variables.scss:variables.css

and this is my error msg:

sass : The term 'sass' is not recognized as the name of a cmdlet, function, script file, 
or operable program. Check the spelling of the name, or if a path was included, verify  
that the path is correct and try again.
At line:1 char:1
  sass variables.scss:variables.css
  ~~~~
      CategoryInfo          : ObjectNotFound: (sass:String) [], CommandNotFoundException
      FullyQualifiedErrorId : CommandNotFoundException

i said okey, i just need to install sass i guess and write to the terminal: npm install -g node-sass

npm : The term 'npm' is not recognized as the name of a cmdlet, function, script file, or 
operable program. Check the spelling of the name, or if a path was included, verify that    
the path is correct and try again.
At line:1 char:1
  npm install -g node-sass
  ~~~
      CategoryInfo          : ObjectNotFound: (npm:String) [], CommandNotFoundException     
      FullyQualifiedErrorId : CommandNotFoundException

sooo i have no idea what should i do or not (i tried other stuff also end up error msgs)

trying to variables.scss to turn css file.

CodePudding user response:

  1. First, you need to download and install Node.js.
  2. Second, ensure the path to the executable has been added to your environment variables.
  3. You may need to restart your computer after this for the changes to take effect.
  4. Run npm install -g sass in the terminal.
  5. Run sass variables.scss variables.css in the terminal.

CodePudding user response:

As you are a beginner, you need to have best practices for use SASS in a projet. First of all, click NodeJS to dowload it. Next, to properly install SASS, here are some steps :

  1. Open your terminal in VSCode and write : npm install -g sass.
  2. Look for the Live Sass Compiler (Glenn Marks) extension.
  3. Initialize a package.json file : npm init

Finally, click SASS to learn more about it.

  • Related