Sass Installation

Beginner
⏱️ 15 min read
📚 Updated: Jul 2026
🎯 5 Examples
Dart Sass CLI

What You’ll Learn

Install official Dart Sass, verify the CLI, and compile your first .scss file to CSS. This page covers npm, package managers, standalone binaries, watch mode, and five practical examples.

01

Dart Sass

Official compiler

02

npm / brew

Common installs

03

Verify

sass --version

04

Compile

SCSS → CSS

05

Watch

Auto-rebuild

06

Practice

5 examples

Why Install Sass?

Browsers understand CSS, not SCSS. A Sass compiler reads your .scss or .sass source and writes standard CSS. You install that compiler once, then run it from the terminal, a GUI app, or your build tool (Vite, Webpack, Parcel, and others often compile SCSS for you).

  • Dart Sass is the primary, actively maintained implementation.
  • The sass command compiles files and can watch for changes.
  • GUI apps (for example CodeKit, Prepros) wrap the same idea with a visual UI.
  • Save source as UTF-8 (see Sass Parsing).
💡
Beginner tip

If you already use Node.js, start with npm install -g sass, run sass --version, then compile one small file. You can swap to a faster install later without changing your commands.

🚀 Choose an Install Path

If you…Try
Use Node.js / npmnpm install -g sass or a project devDependency
Want maximum speed on desktop OSsass-embedded (Node) or standalone / Homebrew / Chocolatey Dart Sass
Prefer no NodeStandalone ZIP/tarball from GitHub releases + PATH
Use Homebrew (macOS/Linux)brew install sass/sass/sass
Use Chocolatey (Windows)choco install sass
Want a GUIApps such as CodeKit (Mac) or Prepros (Mac/Windows/Linux)

📦 Install with npm

Official docs: the Sass team maintains two Node packages that share the standard JavaScript API.

  • sass — pure JavaScript; a bit slower; works everywhere Node works.
  • sass-embedded — JS API around the Dart VM; faster; Windows, macOS, Linux.
terminal
# Global CLI (pure JS implementation)
npm install -g sass

# Or project-local (recommended for teams)
npm install --save-dev sass

# Faster alternative where supported
npm install --save-dev sass-embedded

💻 Standalone, Homebrew & Chocolatey

Standalone: download the OS/CPU package from the Dart Sass GitHub releases, extract the dart-sass folder, and add it to your system PATH. No other dependencies are required (sass.bat on Windows, sass on macOS/Linux).

terminal
# macOS / Linux (Homebrew)
brew install sass/sass/sass

# Windows (Chocolatey)
choco install sass

Community wrappers also exist for Java/Gradle/Maven and other ecosystems—see the official install page when you need those.

✅ Verify & First Compile

After install, confirm the executable works, then compile SCSS to CSS:

terminal
sass --version
sass --help

# Compile one file
sass source/stylesheets/index.scss build/stylesheets/index.css

# Or a simple local pair
sass styles.scss styles.css

sass --version should print a Dart Sass version string (for example 1.69.5 compiled with dart2js …). If the command is not found, fix PATH or use npx sass for a project-local install.

⚡ Quick Reference

GoalCommand
Global npm CLInpm install -g sass
Project npmnpm install -D sass
Check installsass --version
Compile oncesass styles.scss styles.css
Watchsass --watch styles.scss:styles.css
Compressed CSSsass --style=compressed styles.scss styles.css
No source mapsass --no-source-map styles.scss styles.css

Examples Gallery

Commands you will use on day one, plus a tiny stylesheet that compiles to verified CSS.

📚 Getting Started

Install, verify, and compile your first file.

Example 1 — Install the CLI with npm

Global for quick experiments, or local so every teammate shares the same version.

terminal
# Anywhere on your machine
npm install -g sass

# Inside a project (package.json)
npm install --save-dev sass
npx sass --version

How It Works

Global installs put sass on your PATH. Local installs keep the version in package.json; call it with npx sass or an npm script.

Example 2 — Confirm the Install

Always check version and help before debugging “command not found.”

terminal
sass --version
sass --help

How It Works

A version line means the executable is reachable. Official docs recommend this check right after install.

📈 Compile, Watch & Ship

Everyday CLI patterns after Sass is installed.

Example 3 — Compile SCSS to CSS

Write a tiny stylesheet, then compile it once.

styles.scss
$brand: #036;

.button {
  background: $brand;
  color: #fff;

  &:hover {
    background: #024;
  }
}
terminal
sass styles.scss styles.css

How It Works

Link styles.css from HTML. Keep editing styles.scss and recompile (or use watch mode next).

Example 4 — Watch Mode While You Edit

Recompile automatically whenever the source file changes.

terminal
# Single file pair
sass --watch styles.scss:styles.css

# Or watch a folder into another folder
sass --watch scss:css

How It Works

Leave the watcher running during development. Stop it with Ctrl+C when you are done.

Example 5 — Compressed Output for Production

Minify CSS at compile time with --style=compressed.

terminal
sass --style=compressed styles.scss styles.min.css

How It Works

Same stylesheet as Example 3, smaller file for production. Pair with --no-source-map if you do not want .map files in the deploy folder.

🚀 Real-World Use Cases

  • Learning — global sass CLI + a single styles.scss.
  • Team appssass as a devDependency + npm scripts.
  • CI/CD — compile compressed CSS in the pipeline before deploy.
  • Bundlers — Vite/Webpack load SCSS; still useful to know the CLI.
  • Design systems — watch a scss/ folder into css/ during local work.

🧠 How Installation Fits Compilation

1

Install Dart Sass

npm, Homebrew, Chocolatey, standalone, or a GUI app.

Setup
2

Verify CLI

Run sass --version until you see a Dart Sass version.

Check
3

Write SCSS

Create .scss files (UTF-8) with variables, nesting, and more.

Author
4

Ship CSS

Compile (or watch), then link the .css in HTML.

⚠️ Common Pitfalls

  • sass: command not found — PATH issue or use npx sass for local installs.
  • Editing CSS only — changes in generated CSS are overwritten on the next compile.
  • Old LibSass / node-sass — prefer Dart Sass for new projects.
  • Wrong working directory — run the CLI from the folder that contains your paths.
  • Forgetting watch vs one-shot — one compile does not update after later saves.

💡 Best Practices

✅ Do

  • Pin sass in package.json for shared projects
  • Add npm scripts: "build:css", "watch:css"
  • Compile compressed CSS in CI for production
  • Keep source maps in development; omit them in prod if you prefer
  • Learn the Dart Sass CLI, then variables

❌ Don’t

  • Commit huge generated CSS without a clear build step
  • Mix Ruby Sass docs with modern Dart Sass commands
  • Hand-edit output CSS as your source of truth
  • Skip sass --version after a fresh install
  • Assume the browser can load .scss directly

Key Takeaways

Knowledge Unlocked

Five things to remember about Sass installation

Install Dart Sass, verify, compile, watch, then learn the language.

5
Core concepts
💻 02

Many installs

npm / brew / zip

Setup
03

--version

prove it works

Verify
⚙️ 04

sass in out

SCSS → CSS

CLI
👀 05

--watch

dev loop

Workflow

❓ Frequently Asked Questions

Dart Sass—the primary implementation. Install the CLI (standalone, npm, Homebrew, or Chocolatey) or a Node package (sass or sass-embedded). Avoid starting new work on LibSass or Ruby Sass.
Global CLI: npm install -g sass. Project-local: npm install --save-dev sass. Then run sass --version (or npx sass --version for a local install).
The npm sass package is pure JavaScript and a bit slower. sass-embedded wraps the Dart VM and is faster on Windows, macOS, and Linux. The CLI interface is the same.
After installing, run: sass source.scss dest.css. Example: sass styles.scss styles.css. Use sass --watch styles.scss:styles.css to recompile on save.
No. Browsers load CSS. You compile .scss or .sass to .css in development or CI, then link the CSS from HTML.
Both are maintained by the Sass team and share the JS API. sass is pure JS (widest platform support). sass-embedded is faster but targets Windows, macOS, and Linux via the Dart VM.
Did you know?

Official install docs note that the npm sass package is a pure JavaScript build of Dart Sass. It is a little slower than native/embedded options, but the commands stay the same—so beginners can start with npm and upgrade for speed later.

Conclusion

Install Dart Sass with the method that fits your machine, verify with sass --version, then compile (and watch) SCSS into CSS. Once that loop works, you are ready to learn the language features.

Continue with the Dart Sass CLI or Sass Variables.

Next: Dart Sass CLI

Learn one-to-one vs many-to-many compile, --watch, and --style.

Dart Sass CLI →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful