Sublime Forum

Coffeescript build issues

#1

So I have:

{
   "cmd": "/usr/local/bin/coffee", "$file"],
   "selector": "source.coffee"
}

But when I run it I get [Finished]env: node: No such file or directory
If I run it in the terminal normally it works just fine… any ideas?

Many thanks

0 Likes

#2

any ideas?

0 Likes

#3

It looks like node isn’t in the path that Sublime Text 2 is using. You can verify this by typing in the console:

import os
os.environ"PATH"]

This is a common issue on OS X, take a look at stackoverflow.com/questions/1356 … es-in-os-x for example.

0 Likes

#4

Hi, thank you for the reply.

It looks like the issue:

import os
os.environ"PATH"]
‘/usr/bin:/bin:/usr/sbin:/sbin’

It doesn’t have the correct path which is /usr/local/bin I have export PATH="/usr/local/bin:$PATH" in my ~/.profile so I wonder why it isn’t using that? Is there a way I can set the path in sublime?

Many thanks

0 Likes

#5

so I added this to my profile alias s=‘open -a “Sublime Text 2”’ and now if I use s . in my terminal it works and use the right path but using it directly from applications it doesn’t.

0 Likes

#6

I would try putting it in the file ~/.MacOSX/environment.plist, like one of the responses on stack overflow suggests. If that file does not exist, create it. You will have to log out and back in for the environment variables to take effect.

0 Likes

#7

don’t build commands take a ‘path’ argument?

Like so:

{ "cmd": "/usr/local/bin/coffee", "$file"], "selector": "source.coffee", "path": "/usr/local/bin:$PATH" }

0 Likes

#8

I fixed this by editing my CoffeeCompile.sublimesettings file:

"coffee_executable": "/usr/local/bin/coffee", "node_path": "/usr/local/bin"

0 Likes