Lessc Binary Not Available After Installing Less via Npm

lessc: command not found

Just follow the steps :

  1. Make lessc executable by your user(permission denied means you dont have permission to run) like chmod 755 lessc
  2. Export the location of lessc into the PATH like export PATH=$PATH:/home/user/folder/path/less/bin (where lessc is present)
  3. Use lessc lessc boostrap.less

You should put PATH export in environment so that you dont have to do it every time you login See here :
Setting environment variables in OS X?

Less Compiler (lessc) exits without message, with status code 1

As it turns out, I'm not sure why, but the script env for lessc was set improperly.

I found the solution online somewhere in a tutorial of how to install LESS on Ubuntu, I'm not sure where that was.

Anyways... If you open lessc:

user@comp:~$ gksudo gedit /usr/local/bin/lessc

You'll see this first line:

#!/usr/bin/env node

Which you need to set to:

#!/usr/bin/env nodejs

(add js at the end)

And voila! It works flawlessly.

Less file watcher in PhpStorm produces: lessc: ENOENT: no such file or directory

Using the less compiler directly in the project folder via the command -- line works perfectly (e.g. $ lessc styles.less styles.css)

Try doing the same then -- please try with $FileDir$ in the "Working Directory" field.

How to install lessc and nodejs in a Python virtualenv?

I like shorrty's answer, he recommended using nodeenv, see:
is there an virtual environment for node.js?

I followed this guide:
http://calvinx.com/2013/07/11/python-virtualenv-with-node-environment-via-nodeenv/

All I had to do myself was:

. ../bin/activate # switch to my Python virtualenv first
pip install nodeenv # then install nodeenv (nodeenv==0.7.1 was installed)
nodeenv --python-virtualenv # Use current python virtualenv
npm install -g less # install lessc in the virtualenv


Related Topics



Leave a reply



Submit