Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install and run lessc on top of node.js and Windows?

Hi I am learning LESS and I would like to install lessc on my Windows 7.

Following this tutorial http://verekia.com/less-css/dont-read-less-css-tutorial-highly-addictive

The first step is I dowloaded and installed node.js (node-v0.10.5-x64.msi).

Then in a console, I ran

npm install less -g

I got the following:

npm http GET https://registry.npmjs.org/less
npm http 304 https://registry.npmjs.org/less
npm http GET https://registry.npmjs.org/ycssmin
npm http 304 https://registry.npmjs.org/ycssmin
C:\Users\Me\AppData\Roaming\npm\lessc -> C:\Users\Me\AppData\Roaming\npm\node_modules\less\bin\lessc
[email protected] C:\Users\Me\AppData\Roaming\npm\node_modules\less
+-- [email protected]

Then I ran the following in the same console:

lessc style.less > style.css

But I got

'lessc' is not recognized as an internal or external command, operable program or batch file.

I am not sure where I got wrong. I googled but it seems there is too much stuff, not sure which one is right. Did many tests without any success.

Could someone tell me how to do it or give me a pointer to some place with detailed and latest install info for Windows?

like image 631
curious1 Avatar asked May 11 '13 01:05

curious1


People also ask

Should I install Node or NPM first?

Installing NodeIn order to use Express you will first have to install Nodejs and the Node Package Manager (npm) on your operating system. The following sections explain the easiest way to install the Long Term Supported (LTS) version of Nodejs on Ubuntu Linux 20.04, macOS, and Windows 10.

How do I install less CSS on Windows?

Install less on the server via NPM(Node package manager). Execute the command "npm install -g less"into the command prompt. After successful installation of Less you will see the following line on the command prompt.

How do I download lower version of node JS?

To install the LTS version of Node, run nvm install lts . To install a specific version of Node, you need to run nvm list available first so you can see the versions of Node that are available. To install that specific version, run nvm install node-version-number . For example, nvm install 14.20.


2 Answers

In a console, run the following:

node C:\Users\Me\AppData\Roaming\npm\node_modules\less\bin\lessc style.less > style.css

style.less must be in the console's directory.

like image 192
curious1 Avatar answered Sep 22 '22 20:09

curious1


step 1: npm install less -g

step 2: npm i less --save-dev

like image 42
liza Avatar answered Sep 23 '22 20:09

liza