Error “could not delete” with Composer on Vagrant

前端 未结 16 1080
闹比i
闹比i 2020-12-14 05:45

I have a Vagrant running Linux and I\'m trying to install Symfony.

After the command composer create-project symfony/framework-standard-edition ./ \"2.5.*\"

16条回答
  •  既然无缘
    2020-12-14 06:23

    I've came across this issue and spent quite some time making a research. I've tried every single possible option to fix it but none of them worked for me. For me the bug occured on GNU/Linux host with Vagrant and VirtualBox provider.

    It turns out it's a VirtualBox bug related to the file system layer and race conditions when creating/deleting files. It occurs only for VirtualBox shared folders, not for regular ones. The sad part is that it seems like it's not going to be fixed any time soon.

    Some guys reported that they were able to solve the problem using the following tricks:

    • Downgrading to VirtualBox version 6.0.4.
    • Using nfs or rsync instead of shared folders.
    • Patching composer to add some pauses after certain operations.
    • Disabling plugin usage with --no-plugins option.

    But all of this seemed dirty to me. I personally was able to use a workaround suggested on GitHub which is to configure composer to install packages from sources. That's a simple and kind of clean trick which should not have significant negative side effects on your workflow. Try putting the following config into your ~/.config/composer/config.json. Or instead you can edit your composer.json accordingly depending on your needs. Keep in mind that composer.json will override your global config.

    {
        "config": {
            "preferred-install": "source"
        }
    }
    

提交回复
热议问题