I just installed less css compiler using npm
. Now thelessc
file directory is /usr/local/bin/lessc
. i'm not clear what i need to change in lessc
file and how to understand that compiler has been correctly installed.
3 Answers
To Install Less Compiler
sudo npm install -g less
To know the location of it
sudo which lessc
To compile ".less" File to ".css"
lessc /home/--Your LESS File Location--/File.less > /home/--Your CSS File Location--/main.css
/usr/local/bin/
should already be in your $PATH
so there's nothing to do.
Simply use lessc
like you would any other command. Here's a little snippet showing mine is installed like yours, and it parsing some LESS into CSS.
$ sudo npm install -g less
... npm installs less ...
$ which lessc
/usr/local/bin/lessc
$ lessc - <<< 'a{color:white; strong {color:black}}'
a {
color: white;
}
a strong {
color: black;
}
-
its not working. Please suggest me, which line should change in "lessc" file. i am not sure but seem something need to change in my "lessc" file. Aug 26, 2015 at 15:09
-
2I don't understand what you are saying. You shouldn't need to change anything in the lessc file. Please edit your question to show what you see when you run the command.– Oli ♦Aug 26, 2015 at 15:27
-
2