Installing Less on the server side

As an alternative to compiling code on the fly, we can always use the command line to perform the same function—Less comes with a built-in command-line compiler that requires the JavaScript-based Node platform to operate.

Installing Less using Node

We took a look at how you can install Node in Chapter 2, Building a Less Development Toolkit; I will assume that you have installed it using the defaults, as outlined in that chapter. At this point, we now need to install the Less compiler, so bring up a command prompt, change to the location of the project folder we created earlier, and enter the following command:

npm install -g less

You will see it run through a download and install of Less at the command prompt: ...

Get Learning Less.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.