Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

pixelmartyr's avatar

Uninstalling Composer

How do you uninstall composer on a mac? I want to start over. I'm not sure I'm doing this correctly.

0 likes
9 replies
tykus's avatar
tykus
Best Answer
Level 104

Delete the composer binary from /usr/local/bin/composer(or wherever you moved it to - use which composer to locate it). Also delete the .composer directory from your home directory

2 likes
pixelmartyr's avatar

Is it bad to have multiple copies or versions of composer in your computer? I'm so new to this. Thank you tykus.

tykus's avatar

You can have a global composer and/or a local composer. I generally stick to a single global one.

1 like
pixelmartyr's avatar

I'm about to reinstall composer. I'm going to install it globally. After installation, Do I have to mv it to the project folder I'm using?

Then from there, my assumption is that I have to launch if from within my project folder an use the commands from packagist.org to download packages and use them.

Do I have that right?

tykus's avatar

That depends, there is the option to specify the install directory and filename as part of the installations process (see third line):

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php --install-dir=bin --filename=composer
php -r "unlink('composer-setup.php');"

So long as the install directory is in your PATH, you can simply run composer from anywhere in the filesystem (after restarting terminal).

1 like
pixelmartyr's avatar

Ok. I'm getting it. I now have installed composer. I couldn't get the version to show until I did the sudo mv command to make it global. Now things are starting to make sense. Composer version 1.4.2 2017-05-17 08:17:52

pixelmartyr's avatar

Looks like I have composer installed correctly. And installed Globally. So I move on to the usage section of the documentation and I understand what they are talking about. But what I don't understand is where to get the composer.json file.

Iv'e set up a directory for Laravel in MAMP. The directory is called "LARAVEL". I understand that I need to get the composer.json file into it and configure it to connect the appropriate packages from packagist.org. But what is the appropriate way to get the composer.json file into my "LARAVEL" folder in MAMP/htdocs/ ?

mfuller526's avatar

Also delete composer references in your .bashrc and/or .bash_profile files. Note: these files are hidden (.).

Please or to participate in this conversation.