Install package on non-empty folder using composer
Solution 1
You currently can't. There is/was a discussion going on over on GitHub which you can read about here: https://github.com/composer/composer/issues/1135.
For now however, you'll need to create a new directory and then migrate your files over, or vice-versa.
Solution 2
You can check all the . files in the folder.
$ ls -la
Delete any . file in the folder and try again. It worked for me.
Solution 3
For me giving the folder write access worked very well. On windows I right clicked on the mentioned folder and unchecked the Read Only checkbox and saved it and it worked. May be you could also give it a try hope it will work for you as well.
Related videos on Youtube
Comments
-
Abudayah almost 2 years
I tried to install package via composer but it's keep telling me that this directory is not empty so how can I install package on non-empty folder using composer ? is there force install command ?
error message:
[InvalidArgumentException] Project directory Yii-GZero-2b/ is not empty.
-
Tanoro over 5 yearsI agree with cwallenpoole. I consider it a bug. I'm running VirtualBox using Vagrant. My vagrantfile contains the configs for the VM and needs to be in the project directory to run the VM. That means CakePHP won't install in the project directory because it is not empty with the VM configs there. This needs a solution.
-
Luis Milanese almost 5 yearsI really don't understand all those downvotes. The author said more or less the same as what the chosen answer said.
-
Chris almost 4 yearsThanks! I did ls -ls which didnt show the hidden .gitignore file.