在zsh中安装npm后找不到命令 [英] Command not found after npm install in zsh

查看:1098
本文介绍了在zsh中安装npm后找不到命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在通过zsh中的npm安装 vows 时遇到了一些问题.这就是我得到的.我尝试使用-g选项和不使用-g选项安装它.你知道这是怎么回事吗?

I'm having some problems installing vows via npm in zsh. Here's what I get. I tried installing it with and without the -g option. Do you have any idea what's wrong here?

[❤  ~/Desktop/sauce-node-demo:master] npm install -g vows
npm http GET https://registry.npmjs.org/vows
npm http 304 https://registry.npmjs.org/vows
npm http GET https://registry.npmjs.org/eyes
npm http GET https://registry.npmjs.org/diff
npm http 304 https://registry.npmjs.org/eyes
npm http 304 https://registry.npmjs.org/diff
/usr/local/share/npm/bin/vows -> /usr/local/share/npm/lib/node_modules/vows/bin/vows
vows@0.6.4 /usr/local/share/npm/lib/node_modules/vows
├── eyes@0.1.8
└── diff@1.0.3
[❤  ~/Desktop/sauce-node-demo:master] vows
zsh: command not found: vows

谢谢

推荐答案

如果使用Homebrew安装了Node.js,则可以在/usr/local/share/npm/bin中找到npm二进制文件.您应该确保此目录位于PATH环境变量中.因此,在您的~/.zshrc文件中添加export PATH=/usr/local/share/npm/bin:$PATH.

If you installed Node.js using Homebrew, npm binaries can be found in /usr/local/share/npm/bin. You should make sure this directory is in your PATH environment variable. So, in your ~/.zshrc file add export PATH=/usr/local/share/npm/bin:$PATH.

这篇关于在zsh中安装npm后找不到命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆