1

这是我使用的命令:

➜  code  npm ls
/Users/ravindrakumar/code
└── (empty)

➜  code  npm ls -g


➜  code  npm install coffee-script
npm http GET https://registry.npmjs.org/coffee-script
npm http 304 https://registry.npmjs.org/coffee-script
coffee-script@1.6.3 node_modules/coffee-script
➜  code  npm rm coffee-script
unbuild coffee-script@1.6.3
➜  code  npm install -g coffee-script
npm http GET https://registry.npmjs.org/coffee-script
npm http 304 https://registry.npmjs.org/coffee-script
/Users/ravindrakumar/code/Password:/usr/local/bin/coffee -> /Users/ravindrakumar/code/Password:/usr/local/lib/node_modules/coffee-script/bin/coffee
/Users/ravindrakumar/code/Password:/usr/local/bin/cake -> /Users/ravindrakumar/code/Password:/usr/local/lib/node_modules/coffee-script/bin/cake
coffee-script@1.6.3 /Users/ravindrakumar/code/Password:/usr/local/lib/node_modules/coffee-script
➜  code  npm -g ls
/Users/ravindrakumar/code/Password:/usr/local/lib
└── coffee-script@1.6.3

➜  code  ls Password:
usr
➜  code  ls Password:/usr
local
➜  code  ls Password:/usr/local
bin lib
➜  code  ls Password:/usr/local/bin
cake   coffee
➜  code  ls Password:/usr/local/lib
node_modules
➜  code  ls Password:/usr/local/lib/node_modules
coffee-script
➜  code  rm -rf Password:
➜  code  npm -g ls


➜  code

我尝试使用https://gist.github.com/nicerobot/2697848完全卸载节点,npm 但是重新安装后我又遇到了同样的问题。

我也在github中创建了一个问题,仍然没有回复 https://github.com/isaacs/npm/issues/3922

4

1 回答 1

0

我通过更改全局 npm 配置修复了它

➜ 本地 git:(master) ✗ npm config ls -l | grep 配置;cli配置;全局配置 /usr/local/etc/npmrc ;内置配置未定义 globalconfig = "/usr/local/etc/npmrc" userconfig = "/Users/ravindrakumar/.npmrc"

➜ 本地 git:(master) ✗ cat /usr/local/etc/npmrc 前缀 = 密码:/usr/local

我编辑了 npmrc 现在它工作正常

于 2014-04-08T13:15:44.943 回答