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 Answers3

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 
    
muru
  • 207,228
Preet
  • 91
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;
}
Oli
  • 299,380
2

Installation:

sudo apt install node-less

Using:

lessc source_file.less file.css