这是我使用的命令:
➜ 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
[email protected] node_modules/coffee-script
➜ code npm rm coffee-script
unbuild [email protected]
➜ 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
[email protected] /Users/ravindrakumar/code/Password:/usr/local/lib/node_modules/coffee-script
➜ code npm -g ls
/Users/ravindrakumar/code/Password:/usr/local/lib
└── [email protected]
➜ 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
我尝试完全使用卸载npm节点
https://gist.github.com/nicerobot/2697848
但是再次重新安装后,我面临着同样的问题。
我也在github中创建了一个问题,仍然没有回复
https://github.com/isaacs/npm/issues/3922
最佳答案
我通过更改全局npm配置来解决它
➜本地git:(master)✗npm config ls -l | grep配置
; CLI配置
; globalconfig / usr / local / etc / npmrc
;内置配置未定义
globalconfig =“ / usr / local / etc / npmrc”
userconfig =“ /Users/ravindrakumar/.npmrc”
➜本地git:(master)✗cat / usr / local / etc / npmrc
前缀=密码:/ usr / local
我编辑了npmrc现在它可以正常工作
关于node.js - npm install -g创建名为Password:Everytime的文件夹,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/19004326/