3

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}
coffee@0.0.1 /usr/local/lib/node_modules/coffee
├── node-getopt@0.2.3
├── modular-amd@0.1.2
├── chai@1.7.2 (assertion-error@1.0.0)
├── mocha@1.11.0 (growl@1.7.0, debug@0.7.2, commander@0.6.1, diff@1.0.2, mkdirp@0.3.5, ms@0.3.0, jade@0.26.3, glob@3.2.1)
├── express@3.2.6 (methods@0.0.1, fresh@0.1.0, range-parser@0.0.4, cookie-signature@1.0.1, buffer-crc32@0.2.1, cookie@0.1.0, debug@0.7.2, commander@0.6.1, mkdirp@0.3.4, send@0.1.0, connect@2.7.11)
├── sinon@1.7.3 (buster-format@0.5.6)
└── sinon-chai@2.4.0

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.

4

1 回答 1

2

如果你想全局安装 CoffeeScript(正如其中一个标签所暗示的那样),你应该安装coffee-script(不是coffee)。此外,在 Mac 上安装全局模块需要 sudo。

命令:

sudo npm 安装咖啡脚本 -g

输入

% coffee

输出

coffee>
于 2013-10-08T15:52:07.237 回答