less.tmbundle icon indicating copy to clipboard operation
less.tmbundle copied to clipboard

I cannot get compiling to work

Open valentinvieriu opened this issue 14 years ago • 10 comments

I don't see how it can even work. Pressing command + B just pops out a make build

Thank you

valentinvieriu avatar Jan 25 '11 11:01 valentinvieriu

I'm running into some issues as well, though at least for me, [Command] + [B] was the default shortcut. At first it couldn't find the lessc binary, but once I fixed that I get this response from TextMate:

"env: node: No such file or directory"

I get the feeling there's an issue with how it is determining the path to the current file being saved. Any ideas?

RogWilco avatar May 09 '11 23:05 RogWilco

@valentinvieriu try ⌘ + S

@RogWilco You get this message when lessc is failing because Node.js does not find the less module. You get more info by trying to run:

lessc --verbose /path/to/file.less

On OS X, you can fix this by installing the Node Package Manager, npm, (with port: sudo port install npm) and then sudo npm install less -g.

qpleple avatar Oct 06 '11 08:10 qpleple

Doesn't work at all for me. I have the lessc in my PATH: bash-3.2# lessc -h usage: lessc source [destination] When I press save (⌘ + S) it's just showing a tooltip. And no .css with the same name is saved.

cmyk avatar Oct 26 '11 12:10 cmyk

I have the same issue as cmyk.

I was able to get all the errors to go away but now when I ⌘ + S it just shows in a tooltip.

tmtrademark avatar Nov 01 '11 15:11 tmtrademark

Try changing the Save to CSS command to:

#!/usr/bin/env ruby
file = STDIN.read[/lessc: ([^*])+\.less/, 1] || ENV["TM_FILEPATH"].chomp(File.extname(ENV["TM_FILEPATH"]))
system("lessc --verbose \"#{file}.less\" \"#{file}.css\"")

rduenasf avatar Nov 02 '11 00:11 rduenasf

Seems to do the trick! Thanks!

cmyk avatar Nov 05 '11 19:11 cmyk

Stumbled across this thread whilst having the same "env: node: No such file or directory" problem.

I couldn't get any of the given answers on this thread to alleviate the issue.

Ended up just rewriting the Save to CSS command as simply one-line

lessc --verbose $TM_FILEPATH ${TM_FILEPATH%.less}.css

This seems to work ok, if it is of any use to anyone.

ColinWaddell avatar Jun 13 '12 23:06 ColinWaddell

In order to get this to work I had to add /usr/local/bin to my TextMate PATH.

nicholaspufal avatar Jul 09 '12 22:07 nicholaspufal

Thanks @ColinWaddell

guitdev avatar Sep 11 '15 12:09 guitdev

I've just run into this myself. I think it may be down to the fact I recently uninstalled node. It was working fine before.

I ended up here after banging my head against a wall wondering why some new CSS rules I was writing were not 'doing anything' on a web page I was building.

What I found irritating is that the bundle reports success [via the yellow tooltip pane that briefly pops up], even when the CSS hasn't actually compiled. It was only because I happened to look at the last modification date on my CSS file and see that it was months ago, that I noticed it wasn't actually being compiled at all. In spite of that, the Less bundle kept telling me Compiled CSS to /path/to/file.css each time I ran the compile command.

Looking at the code for the command, it's obvious it doesn't error check in any way. It just calls system("lessc ... ") and then prints out "Compiled CSS to ... " whether or not the lessc command succeeded or failed. Is it not possible to 'read back' the result of the lessc command and puts that instead. That would get rid of false positives.

madranet avatar Feb 01 '18 21:02 madranet