sublime-js2coffee icon indicating copy to clipboard operation
sublime-js2coffee copied to clipboard

/bin/sh: js2coffee: command not found

Open adilwali opened this issue 12 years ago • 14 comments

Hopefully I am not adding a duplicate here -- I went through the previously closed issues and didn't see anything that looked the same.

I have installed:

  • node and npm (js2coffee requires these)
  • js2coffee and coffee-script: npm install -g js2coffee coffee-script

And I've installed the Package for Sublime Text via the Package Control. All seemed to go fine. But when I actually run the command to convert something to coffee (via package control), I get this in the output: /bin/sh: js2coffee: command not found

But I can run 'js2coffee' fine from console. I used brew to install it, so it's at: /usr/local/lib/node_modules/js2coffee

Any ideas?

adilwali avatar Nov 04 '12 01:11 adilwali

  1. do you have it symlinked in /usr/local/bin/js2coffee ?
  2. OSX uses a weird PATH env for GUI applications that is different from PATH e.g. compare echo $PATH to launchctl getenv PATH also see: http://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x

I'll have to see how other plugins are handling it to be more robust, I might have to hardcode the path if user is on OSX...

nibblebot avatar Nov 05 '12 15:11 nibblebot

Hey,

I'm on Mac OS X 10.8.2 and tried all the methods in the stackoverflow link but could not make it work. Can you pls help..

jagdishadusumalli avatar Feb 13 '13 13:02 jagdishadusumalli

I get the same error. I have Node/NPM installed through Homebrew and js2coffee is in /usr/local/share/npm/bin/. I symlinked js2coffee in /usr/local/bin/. I then got the error env: coffee: No such file or directory. After symlinking coffee in to /usr/local/bin/ as well, I get the following:

TypeError: Cannot read property 'length' of undefined
  at /usr/local/share/npm/lib/node_modules/js2coffee/lib/helpers.coffee:118:29
  at Object.<anonymous> (/usr/local/share/npm/lib/node_modules/js2coffee/lib/helpers.coffee:125:5)
  at Object.<anonymous> (/usr/local/share/npm/lib/node_modules/js2coffee/lib/helpers.coffee:162:4)
  at Module._compile (module.js:456:26)
  at Object.loadFile (/usr/local/share/npm/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:179:19)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/usr/local/share/npm/lib/node_modules/js2coffee/lib/js2coffee.coffee:13:36)
  at Object.<anonymous> (/usr/local/share/npm/lib/node_modules/js2coffee/lib/js2coffee.coffee:1127:4)
  at Module._compile (module.js:456:26)
  at Object.loadFile (/usr/local/share/npm/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:179:19)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/usr/local/share/npm/lib/node_modules/js2coffee/lib/command.coffee:4:15)
  at Object.<anonymous> (/usr/local/share/npm/lib/node_modules/js2coffee/lib/command.coffee:234:4)
  at Module._compile (module.js:456:26)
  at Object.loadFile (/usr/local/share/npm/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:179:19)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/usr/local/share/npm/lib/node_modules/js2coffee/bin/js2coffee:7:1, <js>:10:3)
  at Object.<anonymous> (/usr/local/share/npm/lib/node_modules/js2coffee/bin/js2coffee:12:4)
  at Module._compile (module.js:456:26)

Any ideas?

deepfriedmind avatar Apr 24 '13 09:04 deepfriedmind

Have the same problem. (Compiling coffeescript in sublime reports the same error, too, but with coffee reported missing instead of js2coffee.)

> which js2coffee
/usr/local/bin/js2coffee

But in Sublime, I get:

/bin/sh: js2coffee: command not found

I’ll try reading the link about GUI apps’ PATHs.

alanhogan avatar May 11 '13 02:05 alanhogan

I updated my PATH via launchctl setenv PATH and verified (via getenv) it now contains /usr/local/bin, but after restarting Sublime Text, I still get the same error:

/bin/sh: js2coffee: command not found

alanhogan avatar May 11 '13 03:05 alanhogan

Same issue ...js2coffee in /usr/local/bin/js2coffee (MacOs 10.6) ...

olih avatar May 18 '13 11:05 olih

Same here. OSX 10.8.3

michaelryancaputo avatar May 21 '13 20:05 michaelryancaputo

Same issue here:

ST2:

/bin/sh: js2coffee: command not found

My terminal output:

$ which js2coffee
/usr/local/bin/js2coffee

andrewmartin avatar Jul 15 '13 00:07 andrewmartin

One thing to consider might be to set the path on a user preferences level like they do in Sublime Coffee Compile. Just a thought. Does anyone have this working? I'd love to see this come into play :+1:

andrewmartin avatar Jul 15 '13 00:07 andrewmartin

Hey all fellow Mac guys, install this great plugin from int3h to fix this issue. https://github.com/int3h/SublimeFixMacPath

justinhernandez avatar Aug 06 '13 17:08 justinhernandez

@justinhernandez Wow, that fix worked instantly! Thank you, my man!

andrewmartin avatar Aug 06 '13 17:08 andrewmartin

@andrewmartin don't thank me! Thank @int3h! :+1:

justinhernandez avatar Aug 06 '13 17:08 justinhernandez

Thank you @int3h! :+1:

andrewmartin avatar Aug 06 '13 20:08 andrewmartin

@andrewmartin @justinhernandez No problem, glad my little plugin could help :) This is exactly the type of thing I created it for.

int3h avatar Aug 06 '13 21:08 int3h