Where to find composer's global packages?

Solution 1:

You can query Composer to find where it has set the user $COMPOSER_HOME directory.

composer config --list --global

The [home] ... line refers to the default value of $COMPOSER_HOME.


The word home can be used as a single parameter as well to show the configuration value.

Example (Windows):

> composer -n config --global home                
C:\Users\<user>\AppData\Roaming\Composer

Example (Linux):

$ composer -n config --global home                
/home/<user>/.composer

Just as a final confirmation - the 'yourname' part in the configuration, would very likely need to be updated with your own Windows username - composer config will say where it put the files.

Solution 2:

You can use

composer global config bin-dir --absolute

Example

PATH=$(composer global config bin-dir --absolute --quiet):$PATH

You need --absolute to get value expanded, and --quiet to discard diagnostics of composer global changing working directory. This was tested with composer 1.10.16 and 2.0.1.

See https://github.com/composer/composer/issues/9354#issuecomment-716827067

Solution 3:

You may find in ~/.config/composer/vendor/bin