sublime-better-coffeescript
sublime-better-coffeescript copied to clipboard
/usr/bin/env: node: No such file or directory
Whenever I hit ALT-SHIFT-D to compile into JS, sublime shows me that above error:
/usr/bin/env: node: No such file or directory
But I already have the binDir specified in CoffeeScript.sublime-settings:
"binDir": "/home/michael-heuberger/npm/bin/"
which is correct because of:
$ which coffee
/home/michael-heuberger/npm/bin/coffee
And it's installed:
$ npm ls -g | grep coffee
├── [email protected]
└─┬ [email protected]
├── [email protected]
Using latest iojs here
$ iojs -v
v2.2.1
Any clues what's wrong?
This stackoverflow answer will likely be your solution. If you look at the top of your /home/michael-heuberger/npm/bin/coffee
file, you should see the line
#!/usr/bin/env node
This is where the /usr/bin/env: node
error is coming from.
One other potential issue:
Some OS's may refer to the node
bin as nodejs
. If that's the case, you should be able to run which nodejs
and then symlink /usr/bin/node
to that in the manner described in the stackoverflow above. Let me know if this helps!
Yes, I've read these discussions too but no luck.
Already have everything here and looks correct:
$ which node
/usr/bin/node
$ /usr/bin/env node
>
(^C again to quit)
>
Any other suggestions?
Also when I run that coffee script directly, it works:
# michael-heuberger at M2 in ~/npm/bin [9:25:35]
$ ./coffee
coffee>
(^C again to quit)
coffee>
# michael-heuberger at M2 in ~/npm/bin [9:25:39]
$ cat coffee
#!/usr/bin/env node
var path = require('path');
var fs = require('fs');
var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
require(lib + '/coffee-script/command').run();
# michael-heuberger at M2 in ~/npm/bin [9:25:50]
$ ./coffee
coffee>