I am attempting to run a composer install to update dependencies on my production server, but I continue to get the following error (this happens to be on a Laravel Forge deployed server).
Loading composer repositories with package information
Installing dependencies from lock file
Package operations: 0 installs, 0 updates, 24 removals
- Removing symfony/dom-crawler (v3.2.1)
[RuntimeException]
Could not delete /home/forge/website.com/vendor/symfony/dom-crawler/composer.json:
Why is this happening? Can I manually delete the entire vendor folder on the forge server and redeploy all the dependencies without harming it?
The problem might be because composer is hitting its timeout. So you might be need increase the time out of composer.
You could take the following measures to gain some speed:
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
Also you might try updating git.
Similar question is discussed Here in laracasts
It might be a permission problem. Maybe at some point you used sudo and the files now are owned by root. If you usually use another user for this operation and now use that one again, the files of course cannot be removed.
So try
ls -l /home/forge/website.com/vendor/symfony/dom-crawler/composer.json
to see which user/group owns the file. Also check the permissions of that directory; maybe it is not writeable anymore?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With