Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OSX -bash: composer: command not found

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 /usr/local/bin/composer 

to install Composer globally.

I had to manually create the /local/bin/composer directory, maybe this caused the error ?

php composer.phar 

works if i in my code directory where the .phar file is.

What could i do to solve the problem and run composer globally ?

My ~/.profile

export PS1="\W: " export CLICOLOR=1 export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx 

~: echo $PATH

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/local/bin ~:  
like image 894
bobbybackblech Avatar asked Jul 29 '14 15:07

bobbybackblech


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.


1 Answers

The path /usr/local/bin/composer is not in your PATH, executables in that folder won't be found.

Delete the folder /usr/local/bin/composer, then run

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

This moves composer.phar into /usr/local/bin/ and renames it into composer (which is still an executable, not a folder).

Then just use it like:

$ composer ... 
like image 172
deceze Avatar answered Sep 17 '22 23:09

deceze