Composer could not find the config file
I want to create a laravel project by composer. I am trying to run this:
composer create-project laravel/laravel c:/laravel --prefer-dist
An error has occurred:
[InvalidArgumentException]
Composer could not find the config file: C:\ProgramData\ComposerSetup\bin
To initialize a project, please create a composer.json file as described in
the http://getcomposer.org/ "Getting Started" section
Composer.json file:
{
"require": {
"laravel/laravel": "4.2.0"
}
}
I am using windows 8 and using cygwin. I also have a proxy on my computer, so I set the path HTTP_PROXY_REQUEST_FULLURI and HTTPS_PROXY_REQUEST_FULLURI to 0 and false
Any idea?
source to share
See: Composer on Windows 7 (x64): number # 1720
The link above recommends deleting the environment variable COMPOSER
.
I tried and it worked.
source to share
Note. As suggested above, remove the environment variables. If you remove the environment variable, you will not be able to successfully execute the composer command, depending on how many times composer is defined in your variables.
as for me, I had composer environment variables other than continuous setup, I had to uninstall them all, I decided to reinstall composer using windows installer and checked the box next to "install as developer" (without including uninstall files) to see where it will be installed and it showed my C: \ directory so I agreed. After successful installation, I opened a new git bash in my project directory and ran
composer install
command. and it was successful.
source to share