Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I cannot get compiling to work #2

Open
valentinvieriu opened this issue Jan 25, 2011 · 10 comments
Open

I cannot get compiling to work #2

valentinvieriu opened this issue Jan 25, 2011 · 10 comments

Comments

@valentinvieriu
Copy link

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

Thank you

@RogWilco
Copy link

RogWilco commented May 9, 2011

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?

@qpleple
Copy link

qpleple commented Oct 6, 2011

@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.

@cmyk
Copy link

cmyk commented Oct 26, 2011

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.

@tmtrademark
Copy link

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.

@rduenasf
Copy link

rduenasf commented Nov 2, 2011

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 added a commit to rduenasf/less.tmbundle that referenced this issue Nov 2, 2011
@cmyk
Copy link

cmyk commented Nov 5, 2011

Seems to do the trick! Thanks!

@ColinWaddell
Copy link

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.

@nicholaspufal
Copy link

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

infininight pushed a commit to textmate/less.tmbundle that referenced this issue Feb 8, 2013
@guitdev
Copy link

guitdev commented Sep 11, 2015

Thanks @ColinWaddell

@madranet
Copy link

madranet commented Feb 1, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants