How to install Dart Sass?
Asked Answered
C

3

24

The instructions on the website say:

You can install Sass on Windows, Mac, or Linux by downloading the package for your operating system from GitHub and adding it to your PATH. That's all—there are no external dependencies and nothing else you need to install.

I downloaded the Windows package from here: https://github.com/sass/dart-sass/releases/tag/1.10.1 and now what? Where do I place the zip? Do I need to extract it? I have no idea what this means - "To install Dart Sass 1.10.1, download one of the packages above and add it to your PATH." Sass is not being recognized when I try to check the version from the command line.

Can someone provide a step by step guide?

I've also installed Ruby, if it matters (but I don't want Ruby Sass, I want Dart Sass).

Cyclopedia answered 28/7, 2018 at 13:22 Comment(2)
Don't know if you still need help, but look at this question: Use SCSS style files within AngularDart 5 and Dart 2Selflove
Firstly, uninstall Ruby Sass, then look at my answer below.Salmagundi
S
28

For windows 10

  1. Go here dart-sass and download dart-sass which is suitable for your operating system.

  2. Extract it where you want.

  3. Open windows search and search this "system environment variables" then click it to open. enter image description here

  4. Click "Environment Variables" enter image description here

  5. Under system varibles find the PATH variable, select it, and click "Edit". enter image description here

  6. If there is no PATH variable, click "New" and write here PATH. enter image description here enter image description here

  7. Go your dard-sass folder and copy directory. enter image description here

  8. Add your directory to the beginning of the variable value followed by ; (a semicolon). For example, if the value was C:\Windows\dart-sass, change it to C:\Users\Me\bin;C:\Windows\dart-sass. If there is not another directory just add your directory here. Then click "Ok". enter image description here

  9. Open "Command Prompt". enter image description here

  10. Write here "sass --version" and click enter to be sure it installed correctly. enter image description here

  11. Create style.scss and style.css file. enter image description here

  12. Write on Command Prompt "cd" then your directory(where is style.scss and style.css file). For example "cd Desktop\webdev" enter image description here

  13. Then write this "sass --watch style.scss style.css". Then minimize it. enter image description here

  14. That's it. You can open your text editor then style.scss file and write your Sass code. It's automatically compile to the css code.

https://katiek2.github.io/path-doc/

Summarize answered 28/8, 2018 at 17:35 Comment(1)
Here is a link that shows Windows and Linux: jakeprice.tech/2018/07/29/setting-up-dart-sass-on-windowsSized
S
0

On Ubuntu

$ sudo snap install dart-sass

Salmagundi answered 31/8, 2023 at 20:51 Comment(0)
M
0

Here are the steps I followed to install dart sass on linux (specifically, a WSL ubuntu instance on my Windows 10 machine).

  1. Download the package from github. At present, that's at https://github.com/sass/dart-sass/releases/tag/1.72.0

    • I chose dart-sass-1.72.0-linux-x64.tar.gz
    • It downloads into the windows downloads folder, as usual
    • The downloaded file can be accessed from a wsl ubuntu shell, such as with $ ls /mnt/c/users/matt/downloads
  2. Extract the downloaded file and save it into the /opt/ directory with:

    $ sudo tar -xvzf /mnt/c/users/matt/downloads/dart-sass-1.72.0-linux-x64.tar.gz -C /opt/
    
    • result: there is now a subdirectory called dart-sass
  3. Add the new directory to PATH permanently by adding to the .bashrc file:

    • open the .bashrc file in a text editor. The file is found under my home directory, i.e. $ ls ~ -a -> shows .bashrc
    • write the following to the end of the file and save:
      # Add sass to path
      export PATH="/opt/dart-sass:$PATH"
      
  4. Open a new terminal and confirm sass is installed:

    $ sass --version                                                                                  
    1.72.0
    
Mukluk answered 21/3 at 20:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.