简体   繁体   English

作曲家无法正常工作

[英]Composer is not working

I am new to Composer and trying to install a package via composer as 我是Composer的新手,并尝试通过composer安装软件包

$ php composer require intervention/image

but i am getting 但我越来越

Could not open input file: composer 无法打开输入文件:作曲家

error since i have just run my last composer command 10 mins ago. 错误,因为我10分钟前刚刚运行了我的最后一个composer命令。 I don't now what is causing that problem. 我现在不是导致该问题的原因。 Any help would be appreciated. 任何帮助,将不胜感激。

Try the following, then execute your command again. 请尝试以下操作,然后再次执行命令。

$ curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer

Then you can use composer instead of php composer ... 然后,您可以使用composer而不是php composer ...

Source 资源

Most probably in your case Composer was installed globally, as a stanalone application . 在您的情况下,很可能Composer是作为独立应用程序全局安装的。

Instead of 代替

php composer require intervention/image

run

composer require intervention/image

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

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