How to install SASS in Linux?

Tools | 04 July 2018

SASS is the best CSS preprocessor out there. Using a preprocessor like SASS makes your CSS journey more easier, efficient, readable, maintainable and organized. SASS has amazing capabilities which could be learnt quickly here and here.

In this page, you will learn how to install SASS in Linux easily without using any package manager. In case if you wish to install in any other OS or using a package manager, you can visit SASS official installation instructions.

1. Download SASS from GitHub

Head over to the SASS GitHub page and download the *.tar.gz file based on your linux os version. To check your linux architecture, use the below command in your linux terminal.

Get Linux OS versioncmd
uname -m

2. Unzip and Untar

After downloading the .tar.gz file, unzip it and untar it. You will see a dart-sass directory.

3. Add it to PATH

Copy the path of the dart-sass directory and add it to PATH. To view PATH variables, you can use the below command.

View PATH variablescmd
echo $PATH

If you have .cshrc file in your OS, add the below line to your .cshrc file and source it.

Add to PATHcmd
setenv PATH "$PATH\:path_to_dart-sass"

Make sure you add the absolute path of dart-sass directory in the above command. Also, remember to include :\ between $PATH and path_to_dart-sass.

After adding and saving this line in .cshrc file, you can source it in your terminal. Now, SASS is installed and you are ready to use it!

Note: If you have .bashrc file in your linux environment, you can follow the guide here on adding dart-sass directory to the PATH.

Basic SASS usagecmd
sass input.scss output.css

In case if you found something useful to add to this article or you found a bug in the code or would like to improve some points mentioned, feel free to write it down in the comments. Hope you found something useful here.

Happy learning!