Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lesscss command line compiler Lessc

Tags:

macos

less

Hi Im trying to get the LessCss command line compiler installed on a Mac.

I've tried

brew install less
Error: No available formula for less

brew install lessc
Error: No available formula for lessc

sudo npm install -g less
..Installs happily..

sudo npm install -g lessc
npm http GET https://registry.npmjs.org/lessc
npm http 404 https://registry.npmjs.org/lessc
npm ERR! 404 'lessc' is not in the npm registry.

npm install less --global
..Installs happily..

npm install lessc --global
npm http GET https://registry.npmjs.org/lessc
npm http 404 https://registry.npmjs.org/lessc
npm ERR! 404 'lessc' is not in the npm registry.

and all I get is

less js/less/style.less > style-theme.css
-bash: less: command not found

lessc js/less/style.less > style-theme.css
-bash: lessc: command not found

Does anyone have any experience with this?


I found something said my path variable might be messed up. This:

/bin/echo $PATH

gets me:

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin
like image 529
RachelD Avatar asked Sep 21 '13 01:09

RachelD


3 Answers

the npm package name for lessc is less

try writing

sudo npm install -g less
like image 80
amdorra Avatar answered Dec 19 '22 17:12

amdorra


I will try to provide a complete answer.

All commands must be executed in the Terminal application.

  1. If you don't have it: Install Command Line Tools for Xcode

    xcode-select --install

  2. If you don't have it: Install HomeBrew

    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

  3. If you don't have it: Install Node.js

    brew install node

  4. Install LessCSS

    sudo npm install -g less

Now you can execute lessc commands.

like image 45
Jeroen Vermeulen - MageHost Avatar answered Dec 19 '22 16:12

Jeroen Vermeulen - MageHost


i`m using macOS Siera and work for me, you can try:

  1. install npm using brew:

    brew install node

  2. check node and npm version using:

    node -v npm -v

3.change user to SU using:

sudo su

  1. install less:

npm install -g less

Good Luck.....

like image 37
lucky kurniawan Avatar answered Dec 19 '22 15:12

lucky kurniawan