1

I installed coffee-script as per directions.

$ npm install http://github.com/jashkenas/coffee-script/tarball/master
npm http GET http://github.com/jashkenas/coffee-script/tarball/master   
npm http 200 http://github.com/jashkenas/coffee-script/tarball/master
npm http GET https://registry.npmjs.org/mkdirp
npm http 200 https://registry.npmjs.org/mkdirp
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] 'repositories' (plural) Not supported.
npm WARN package.json Please pick one as the 'repository' field
npm WARN package.json [email protected] No repository field.   
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
[email protected] node_modules/coffee-script
└── [email protected]

yet when i execute 'coffee' command i get

$ coffee
-bash: coffee: command not found

What am i doing wrong?

PS: i am doing this on Mac Terminal

EDIT: -

Same problem is occurs when i install nodemon the npm install takes place similar to above. But when i input a nodemon command on $ prompt it says -bash: nodemon: command not found

2 Answers 2

4

I installed coffeescript on my mac yeasterday as a matter of fact. Here is how I did it:

First of all, go install NodeJS.

Then go in Terminal and type the following: sudo npm install -g coffee-script

That's it - If you type in coffee in Terminal, it should start without a problem

2

Anything you want to run as a command (nodemon, coffee, node-inspector) must be installed with npm install -g the-package-name. If you use npm install it just puts it into your local node_modules directory and won't create the symlink for command line execution.

If you find that you need to use sudo, you might want to read this blog post: http://howtonode.org/introduction-to-npm:

what, no sudo?

I strongly encourage you not to do package management with sudo! Packages can run arbitrary scripts, which makes sudoing a package manager command as safe as a chainsaw haircut. Sure, it's fast and definitely going to cut through any obstacles, but you might actually want that obstacle to stay there.

I recommend doing this once instead:

sudo chown -R $USER /usr/local

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.