4
votes

I installed node, npm and coffee script and when I try to run the coffee command I get "-bash: coffee: command not found"

http://cl.ly/image/1Z2t1U1O1I0z

I'm not sure if the $PATH is whats wrong, all the google results would indicate thats my problem. Clearly I'm new to this and I went a little overboard but I tried added every path npm gave me:

$path = /usr/local/share/npm/bin/coffee:/usr/local/share/npm/bin/cake:/usr/local/share/npm/lib/node_modules/coffee-script/bin/cake:/usr/local/share/npm/lib/node_modules/coffee-script/bin/coffee:node_modules/coffee-script:/usr/local/share/npm/lib/node_modules/coffee-script:/Users/asmith:/usr/local/bin/node:/usr/local/bin/npm:~/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

Human readable:

  • /usr/local/share/npm/bin/coffee
  • /usr/local/share/npm/bin/cake
  • /usr/local/share/npm/lib/node_modules/coffee-script/bin/cake
  • /usr/local/share/npm/lib/node_modules/coffee-script/bin/coffee
  • node_modules/coffee-script
  • /usr/local/share/npm/lib/node_modules/coffee-script
  • /Users/asmith
  • /usr/local/bin/node
  • /usr/local/bin/npm
  • ~/bin
  • /usr/local/bin
  • /usr/bin
  • /bin
  • /usr/sbin
  • /sbin
  • /usr/local/bin

Any help would be great!

1
You should have directories on your path, rather than executables (i.e. /usr/local/share/npm/bin instead of /usr/local/share/npm/bin/coffee and /usr/local/share/npm/bin/cake)Aaron Dufour

1 Answers

6
votes

Yes - this is a path problem.

The path you actually need is probably just /usr/local/share/npm/bin

You don't need to add the paths of the executables themselves, you need to add the path to the directory that they live in.