Composer: Failed to initialize global composer: Composer could not find the config file: /Users/{username}/.composer/composer.json

Created on 8 Jun 2020  路  1Comment  路  Source: composer/composer

Im trying to run the following command in a directory (we'll use /var/www/example for example)
composer create-project symfony/website-skeleton my_project_name
This is the setup for a php symfony application, but I don't think that is important.

The result is the following when i add the flag -vvv:

Failed to initialize global composer: Composer could not find the config file: /Users/{username}/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Checked CA file /usr/local/etc/[email protected]/cert.pem: valid
Creating a "symfony/website-skeleton" project at "./example"
Downloading https://repo.packagist.org/packages.json
Writing /Users/{username}/.composer/cache/repo/https---repo.packagist.org/packages.json into cache
Reading /Users/{username}/.composer/cache/repo/https---repo.packagist.org/p-provider-2013.json from cache
Reading /Users/{username}/.composer/cache/repo/https---repo.packagist.org/p-provider-2014.json from cache
Reading /Users/{username}/.composer/cache/repo/https---repo.packagist.org/p-provider-2015.json from cache
Downloading http://repo.packagist.org/p/provider-2016%24053550c94f0a6064084aa6b1ec16e31921d1296f504fe33906bd205a4665429a.json

Eventually, my packages are downloaded but note the Failed to initialize global composer... is not trying to look in the directory i'm currently in: /var/www/example, but rather my home folder?

I also took note of: Checked CA file /usr/local/etc/[email protected]/cert.pem: valid
Im using a version of PHP installed with homebrew, but im unsure if this is related to #8911 ?

When I use PHP 7.3.11 bundled with MacOS 10.15.5, the result is the same with the following variation: Checked CA file /private/etc/ssl/cert.pem: valid

Anyone else having this issue?

I should add to this: composer is in fact working on my system, but i'm curious about this debug information and if there is anything to be concerned with and any possible resolutions

Support

Most helpful comment

It means the global composer failed to initialize, which means globally installed plugins and such do not initialize. It's not a problem really. The way it fails I think it just means you have nothing set up in the global dir so it's simply stating it didn't load.

>All comments

It means the global composer failed to initialize, which means globally installed plugins and such do not initialize. It's not a problem really. The way it fails I think it just means you have nothing set up in the global dir so it's simply stating it didn't load.

Was this page helpful?
0 / 5 - 0 ratings