10

I just installed less css compiler using npm. Now thelesscfile 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 3

9
  • 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 
    
5

/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;
}
3
  • 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
  • 2
    I 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
    @NajimSujon What exactly do you mean by 'Not Working'?
    – Thomas Ward
    Aug 26, 2015 at 15:36
2

Installation:

sudo apt install node-less

Using:

lessc source_file.less file.css

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .