Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm doesn't install global modules correct

There's a problem with installing my global modules properly.

My System

  • OS: OS X Mountain Lion
  • node.js: 0.10.18 (Package installer)

Steps to reproduce

Input

npm install coffee -g (or any other module)

Output

npm http GET https://registry.npmjs.org/coffee
npm http 200 https://registry.npmjs.org/coffee
{lots of dependencies}
[email protected] /usr/local/lib/node_modules/coffee
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
└── [email protected]

Input

coffee

Output

-bash: coffee: command not found

Other information

  • npm config get prefix: /usr/local
  • Read/Write access für /usr/local: Yes
  • $PATH: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin
  • /usr/local/share/npm exists: No
  • /usr/local/lib/node_modules/coffee exists: Yes
  • /usr/local/bin/coffee exists: No

What else can I do?

I won't add the direct link to coffee to my $PATH-variable, because that's not my job, that's the job of npm! Really, why should I use npm when I could do it by myself? I read that answer like 100 times and I have no words for this, which aren't against the rules on SO.

like image 894
Fabio Poloni Avatar asked Apr 17 '26 01:04

Fabio Poloni


1 Answers

If you want to install CoffeeScript globally (as one of the tags suggests), you shall install coffee-script (not coffee). Additionally, sudo is required for installing global module on the Mac.

Command:

sudo npm install coffee-script -g

Input

% coffee

Output

coffee>
like image 178
Andrei Karpushonak Avatar answered Apr 20 '26 11:04

Andrei Karpushonak



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!