我在终端上执行了以下操作:
$ curl -sS https://getcomposer.org/installer | php
输出如下:
All settings correct for using Composer
Downloading...
Composer successfully installed to: /Applications/XAMPP/xamppfiles/htdocs/composer.phar
Use it: php composer.phar
然后我输入:
$ sudo mv composer.phar /usr/local/bin
这个没有问题(因为usr/local/bin在我的$PATH中),但是现在该怎么运行它呢?当我在命令行输入composer或composer.phar时,会得到以下结果:
-bash: composer: command not found
-bash: composer.phar: command not found
php composer.phar
吗?权限设置正确吗? - vicvicvic$ mv composer.phar /usr/local/bin/composer
,那么你可以通过在终端中键入composer
来全局使用它。 - Omer