Error “could not delete” with Composer on Vagrant

前端 未结 16 1069
闹比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:36

    We're running into issues also. There are several people who seem to have this issue, a fix has not been provided. For more information you can look into github issues of vagrant-winnfsd.

    0 讨论(0)
  • 2020-12-14 06:37

    I was trying to update project dependencies (using composer update) during a Laravel Framework upgrade exercise in my local Homestead environment (having run vagrant ssh to login as the default "vagrant" user) and none of the previous answers in this thread made any difference to the...

    Could not delete /home/vagrant/projects/projectname/vendor/kylekatarnls/update-helper/src/UpdateHelper
    

    ...error message I repeatedly encountered.

    The only thing that worked for me was to include a composer option as follows:

    composer update --no-plugins
    

    Plugins are used to alter or extend the functionality of Composer. The above command disables all installed plugins. Unfortunately, I'm not clear as to why this command worked for me, as I certainly haven't written any plugins myself. All I can conclude is that there was an erroneous Composer plugin installed that was causing this issue.

    0 讨论(0)
  • 2020-12-14 06:38

    In my case I was trying composer update but I got

    [RuntimeException] Could not delete .../vendor/bin/php-parse:

    Despite I'm using Laravel framework, this question was the first link in Google, so I decided to post an answer.

    My solution was to grant ownership for vendor: sudo chown -R $USER:www-data vendor/ and
    sudo chown -R $USER:www-data composer.json


    Update: my host OS was Ubuntu 16.04.

    0 讨论(0)
  • 2020-12-14 06:38

    This has something do to with the synchronization of the folders between host and guest OSes, the folder might be simply temporarily locked from your host machine.

    The solution is simply to delete the offending .git folder from your host OS or reboot the machine and launch composer install again.

    Ideally each OS has its own dependencies and different binaries, therefore you should isolate your /vendor folder out from the rsync/vagrant folder share, likewise you would do the same with /node_modules on a Nodejs project.

    0 讨论(0)
提交回复
热议问题