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

/bin/sh: js2coffee: command not found #5

Open
adilwali opened this issue Nov 4, 2012 · 14 comments
Open

/bin/sh: js2coffee: command not found #5

adilwali opened this issue Nov 4, 2012 · 14 comments

Comments

@adilwali
Copy link

adilwali commented Nov 4, 2012

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?

@nibblebot
Copy link
Owner

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

@jagdishadusumalli
Copy link

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

@deepfriedmind
Copy link

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?

@alanhogan
Copy link

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
Copy link

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

@olih
Copy link

olih commented May 18, 2013

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

@michaelryancaputo
Copy link

Same here. OSX 10.8.3

@andrewmartin
Copy link

Same issue here:

ST2:

/bin/sh: js2coffee: command not found

My terminal output:

$ which js2coffee
/usr/local/bin/js2coffee

@andrewmartin
Copy link

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 👍

@justinhernandez
Copy link

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

@andrewmartin
Copy link

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

@justinhernandez
Copy link

@andrewmartin don't thank me! Thank @int3h! 👍

@andrewmartin
Copy link

Thank you @int3h! 👍

@int3h
Copy link

int3h commented Aug 6, 2013

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

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