首页 > 终端下使用 npm 时按 tab 无法自动补全?

终端下使用 npm 时按 tab 无法自动补全?

OSX10 iterm + ohmyzsh 下 npm 后面跟tab会报错。

➜ ~  npm egrep: empty (sub)expression
egrep: empty (sub)expression
egrep: empty (sub)expression

有遇到同样问题的吗?


~/.zshrc最后追加

. <(npm completion)

重启iterm,解决。

参考:https://www.npmjs.org/doc/cli/npm-completion.html

【热门文章】
【热门文章】