CoffeeScript-Sublime-Plugin
CoffeeScript-Sublime-Plugin copied to clipboard
None of the plugin commands work
I cannot get any of the commands for this plugin to work. Any time I try to do something like check syntax (Alt+Shift+S) nothing happens and I get this line in the status bar: "Syntax env: node: No such file or directory"
I'm on OS X 10.8.1
I assumed this was a path problem, but the Sublime path and my system path match:
import os os.environ["PATH"] '/usr/local/mysql/bin:/usr/local/share/npm/bin:/Users/greg/.rvm/gems/ruby-1.9.3-p194/bin:/Users/greg/.rvm/gems/ruby-1.9.3-p194@global/bin:/Users/greg/.rvm/rubies/ruby-1.9.3-p194/bin:/Users/greg/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/greg/.rvm/bin:$HOME/bin'
In the command line:
which node /usr/local/bin/node
So 'node' should be on the path.
I had a similar problem with not being able to find 'coffee', but I was able to resolve that after finding 'binDir' in 'CoffeeScript.sublime-settings'. It defaults to '/usr/local/bin' while the directory 'coffee' is in is '/usr/local/share/npm/bin'.
I installed 'coffee' the recommended way:
npm install -g coffee-script
And I installed 'node' with:
brew install node
Really sounds like some form of PATH problem to me, I'll look into it but it works for most people including me and I'm on OS X 10.8.1.
I believe I installed npm and node the same way. I'll look into it.
Hi!
@dangerbell
Here is a fix.
I was having the same trouble, I installed coffeescript the same way, and I'm using 10.8.2.
I once I changed my coffeescript.sublime-build "binDir" variable to /usr/local/share/npm/bin, I got the same error as you: it couldn't find node
So I made another symlink to my original coffeescript bin using the terminal:
ln -s /usr/local/share/npm/lib/node_modules/coffee-script/bin/coffee /usr/local/bin/coffee
And I changed my "binDir" back to the default /usr/local/bin .
My guess is that Xavura's sublime text coffeescript plugin needs to access both coffee and node binaries, and they need to be in the same folder (since there's only one "binDir" variable.
I am very new to these things, but it seemed to work. I can check syntax with the key shortcuts, etc.
@Xavura I wonder though, is there any way to have the output display besides in the one line status bar? I assumed it would have been printed in the console for a more permanent log. I apologize in advance if this is an obvious question, I'm still getting familiar with all of this stuff.
@dangerbell This isn't the first time someone has had problems with paths so I'll look into improving this.
@kdavh Display what exactly in the status bar? It's possible, I'm sure some things use the status bar already. You should open another issue. :)
I had the same problem. I solved it by putting both paths (coffee's and node's) on my binDir, as follows:
"binDir": "/usr/local/share/npm/lib/node_modules/coffee-script/bin:/usr/local/bin"
Note that the paths are separated by a colon symbol (":"), as normally expected from library paths.
I am running node 0.10.1 with npm 1.2.15 and it installs coffee to /usr/local/share/npm/bin. So this worked for me:
CoffeeScript.sublime-settings:
"binDir": "/usr/local/share/npm/bin:/usr/local/bin"
Adding both the location of the coffee command and node to the "binDir" variable fixed this for me.
It looks like Node installs a link "node" in /usr/local/bin which is the default for "binDir" in Packages/CoffeeScript/CoffeeScript.sublime-settings. CoffeeScript does not create a link there. I opted to follow kdavh's advice above to create a symbolic link: "ln -s /Users/me/.npm/coffee-script/1.6.3/package/bin/coffee /usr/local/bin/coffee" and it worked like a charm.