I have now read many tutorials on this and would like to show you the way the installation worked for me. I have now used homebrew because it does not cause problems with missing rights on mac.
This is how i proceeded:
- uninstall node and node-sass
- install xcode: https://itunes.apple.com/us/app/xcode/id497799835?mt=12
- install homebrew
run this command in terminal
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
(takes a time, more information: https://brew.sh/)
3.1 If you have Mac with M1 chip run
touch ~/.zshrc
open -a textedit ~/.zshrc
write the following line in the file and save:
eval $(/opt/homebrew/bin/brew shellenv)
(more info: https://apple.stackexchange.com/a/413207 and https://github.com/Homebrew/discussions/discussions/938#discussioncomment-407419)
- install node
brew install node
4.1 If you have Mac with M1 chip and terminal says: "zsh: command not found: brew"
And if also in the process this mesaage appear: "Warning: /opt/homebrew/bin is not in your PATH."
Do this:
export PATH=/opt/homebrew/bin:$PATH
(more information: https://stackoverflow.com/a/65493486/9739794, https://github.com/Homebrew/brew/issues/10152)
Repeat step 4
- install node-sass
brew install node-sass
- Write homebrew in $PATH
sudo nano /etc/paths
Add one line with this content and save:
/opt/homebrew/bin
(more information: https://techpp.com/2021/09/08/set-path-variable-in-macos-guide/#Setting_the_PATH_Variable_Temporarily, https://www.architectryan.com/2012/10/02/add-to-the-path-on-mac-os-x-mountain-lion/#.Uydjga1dXDg)
- Off course, install "sass-autocompile" package for atom: https://atom.io/packages/sass-autocompile#examples
Now you should activate compiling in Atom under "Packages" > "Atom Sass" > "compile file". Then every time you save a Sass file, the CSS file should be created automatically.