Ubuntu – “command not found” when running “lessc” from bash

bashcss

I have installed lessc via npm, Node.js Package Manager, and when I run lessc from terminal using

lessc /var/www/less/style.less /var/www/css/style.css

it works perfectly.
However, when I put this exact same command in a bash script, less.sh, it returns the error

lessc : command not found.

Also, I need to run this command from a bash script, because incron, a program which I am using to re-compile my less script each time they are modified, is unable to run the command mentioned above, which I believe may be caused by weird methods for handling white-space in the command.

Best Answer

npm install -g less

That installs Less.js globally. Maybe you tried this already but it's not in the documentation on http://lesscss.org/; I had to ask around in #node.js on FreeNode.