我的全局模块安装出现了问题。
我的系统
- 操作系统: OS X Mountain Lion
- node.js: 0.10.18 (包安装程序)
复现步骤
输入
npm install coffee -g
(或者其他任何模块)
输出
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
输入
coffee
输出
-bash: coffee: command not found
其他信息
npm config get prefix
:/usr/local
/usr/local
的读/写访问权限: 是$PATH
:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin
/usr/local/share/npm
是否存在: 否/usr/local/lib/node_modules/coffee
是否存在: 是/usr/local/bin/coffee
是否存在: 否
还能做什么?
我不会将coffee的直接链接添加到我的$PATH
变量中,因为那不是我的工作,那是npm
的工作!真的,为什么我要使用npm,而不是自己做呢?我已经读了那个答案100遍,对此我没有任何言语,这些言语都违反了SO的规定。