Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composer: Command Not Found

From within the directory holding my composer.phar file, I can't execute any composer commands.

I can see Composer is running when I execute

php composer.phar  

But any direct composer statements fail.

Not sure if it matters but Composer was included within a cloned repository.

I just want to install a single Oauth library, then likely not touch Composer again for several months, so I don't need to run it globally. I'm just confused why I can't run Composer from within this directory.

like image 443
Brandon Buster Avatar asked Dec 01 '15 19:12

Brandon Buster


People also ask

How do I fix composer not found?

If reinstalling Composer using official commands doesn't work, you may try directly running composer-setup. php with the default --install-dir and --filename argument. The composer-setup. php can be downloaded from https://getcomposer.org/installer.

Why is my composer not working?

Make sure you have no problems with your setup by running the installer's checks via curl -sS https://getcomposer.org/installer | php -- --check . Try clearing Composer's cache by running composer clear-cache . Ensure you're installing vendors straight from your composer.

Where is the composer command?

you need to right click on project and use composer here then only you can perform composer install,composer update, php artisan and all .


1 Answers

This problem arises when you have composer installed locally. To make it globally executable,run the below command in terminal

sudo mv composer.phar /usr/local/bin/composer 

For CentOS 7 the command is

sudo mv composer.phar /usr/bin/composer 
like image 111
drowsyTicker Avatar answered Oct 14 '22 19:10

drowsyTicker