简体   繁体   English

-重击: <npm-package> :找不到命令[Mac]

[英]-bash: <npm-package>:command not found [Mac]

I've been installing a lot of packages from Github via NPM. 我已经通过NPM从Github安装了很多软件包。 For example, Moneda. 例如,莫内达(Moneda)。

When I try to run the package, I get 当我尝试运行程序包时,我得到

-bash: moneda: command not found

This happens for every package I install with NPM from Github. 我使用Github的NPM安装的每个软件包都会发生这种情况。

I've tried resetting bash completely. 我已经尝试过完全重置bash。

This is what I get when typing echo $PATH : 这是我在输入echo $PATH时得到的:

/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

I've tried uninstalling brew, npm, node and reinstalling them all, still not working. 我尝试卸载brew,npm,node并重新安装它们,但仍然无法正常工作。 I don't know how to fix this. 我不知道该如何解决。

The bigger question is : where does npm install its packages? 更大的问题是: npm在哪里安装其软件包? If the configuration directory of npm is ~/.npm-global , then you have to update your PATH 如果npm的配置目录是~/.npm-global ,则必须更新PATH

export PATH=~/.npm-global/bin:$PATH

More information can be found here 更多信息可以在这里找到

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM