bash Mac OS 终端:无法在全局环境中获取 composer
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21643507/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Mac OS Terminal: Can't get composer on the global environment
提问by JofryHS
So I have been trying to setup my MAMP and Laravel but stuck at getting the composer to work.
所以我一直在尝试设置我的 MAMP 和 Laravel,但坚持让作曲家工作。
I have installed MAMP, and I use the command:
我已经安装了 MAMP,并使用以下命令:
curl -sS https://getcomposer.org/installer | php
curl -sS https://getcomposer.org/installer | php
and I tried running
我试着跑步
php composer.phar
php composer.phar
everything works so far.
到目前为止一切正常。
Then when I tried to put composer into my global path (I assume the following line does it)
然后当我尝试将 Composer 放入我的全局路径时(我假设以下行做到了)
mv composer.phar /usr/local/bin/composer
mv composer.phar /usr/local/bin/composer
I receive this error
我收到此错误
mv: rename composer.phar to /usr/local/bin/composer: No such file or directory
mv: rename composer.phar to /usr/local/bin/composer: No such file or directory
I tried mv composer.phar /usr/local/bin
as well it gives the same error.
我也试过mv composer.phar /usr/local/bin
它给出了同样的错误。
Here is my echo $PATH
:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
这是我的echo $PATH
:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
Any pointers on resolving this? Oh, Mac Rookie here.
有关解决此问题的任何指示?哦,Mac Rookie 来了。
回答by Edward Dale
Make sure that /usr/local/bin
exists. That's the error that you get when the target directory doesn't exist.
确保/usr/local/bin
存在。这是当目标目录不存在时你得到的错误。