Error "could not delete" with Composer on Vagrant
It happened once to me and it turns out that I was hitting composer's timeout.
You could take the following measures to gain some speed:
- Increase composer process-timeout (default 300) (not really needed if the following settings will help you gain speed, but can't hurt)
- Set
dist
as preferred install type. - Enable
https
protocol for github, which is faster.
~/.composer/config.json
{
"config": {
"process-timeout": 600,
"preferred-install": "dist",
"github-protocols": ["https"]
}
}
If you still have problems after that, you can also clear composer's cache:
rm -rf ~/.composer/cache
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.