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?

+3


source to share


9 replies


Remove environment variable composer . And it will work.



+12


source


I found a solution like this:

COMPOSER=composer.json composer create-project laravel/laravel c:/laravel --prefer-dist

      



and it works!

+5


source


See: Composer on Windows 7 (x64): number # 1720

The link above recommends deleting the environment variable COMPOSER

.

I tried and it worked.

+1


source


I removed the composer environment variable . Worked for me.

+1


source


Have you put your composer.json in c: / Laravel? If yes in your cmd:

C:\> cd Laravel

C:\Laravel> composer create-project laravel/laravel project-name --prefer-dist

      

0


source


You don't have to clear the environment variable to work. If the variable name was composer, you should only change the name to the composite path. This works for me.

0


source


Just make sure that all users restart the doc command line windows after uninstalling env, going to start type env, click "Environmental", find composer under the system and delete the line. I spent an hour until I realized that I needed to restart the command prompt window.

0


source


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.

0


source


Guys, could you please clarify how I am going to delete the composer environment variable? I have the same problem.

0


source







All Articles