Composer找不到配置文件:C:\ Users \ Username \ AppData \ Roaming \ Composer \ vendor \ bin

时间:2015-02-19 04:09:18

标签: laravel composer-php git-bash

我似乎无法使用以下命令安装Laravel:composer create-project laravel/laravel laravel-testing --prefer-dist因为它不断抛出以下错误:

 [InvalidArgumentException]
 Composer could not find the config file: C:\Users\Kieran\AppData\Roaming\Co
 mposer\vendor\bin
 To initialize a project, please create a composer.json file as described in
  the http://getcomposer.org/ "Getting Started" section

enter image description here

以下路径中不存在供应商 bin 文件夹,因此我在其中创建了文件夹vendor,然后是bin仍然没有运气:

C:\Users\Kieran\AppData\Roaming\Composer\vendor\bin

我做错了什么?

1 个答案:

答案 0 :(得分:4)

我设法解决了这个问题。我不得不删除composer环境变量。可在此处找到:Control Panel>System>Edit the system environment variables>Environment variables>composer>delete

删除后,我可以运行我想要的命令,没有任何错误,并按预期工作:composer create-project laravel/laravel laravel-testing --prefer-dist