OSX -bash: composer: command not found

前端 未结 10 965
我寻月下人不归
我寻月下人不归 2020-12-22 18:52

If i type \"composer\" i get the above error message.

I did on my macbook:

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /us         


        
相关标签:
10条回答
  • 2020-12-22 19:24

    Tested on Mac OSX after installing via instructions on composer website:

    sudo mv composer.phar /usr/local/bin/composer
    
    0 讨论(0)
  • 2020-12-22 19:24

    This works on Ubuntu;

    alias composer='/usr/local/bin/composer/composer.phar'
    
    0 讨论(0)
  • 2020-12-22 19:25

    If you have to run composer with sudo, you should change the directory of composer to

    /usr/bin
    

    this was tested on Centos8.

    0 讨论(0)
  • 2020-12-22 19:29

    Globally install Composer on OS X 10.11 El Capitan

    This command will NOT work in OS X 10.11:

    curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/bin --filename=composer 
    

    Instead, let's write to the /usr/local/bin path for the user:

    curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
    

    Now we can access the composer command globally, just like before.

    0 讨论(0)
提交回复
热议问题