After a lot of effort I finally managed to get my composer (with drush) working with Drupal 8.5.3 However I would like to update Drupal to latest version with composer.
Updating composer with sudo doesnt gives me errors but doesnt update my Drupal.
I used this command from my project dir;
sudo composer update drush/drush --with-dependencies
I read that it's bad practice to use sudo for composer and because it doesnt update my Drupal
I try using composer update without sudo. First I got some warnings that cache could not be used. Because they're only warnings I ignored them.
After some time it sees 11 updates and right after that I got a big red errormessage;
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 11 updates, 0 removals
[RuntimeException]
/path-to-my-site/drupal-composer-build/vendor/symfony/polyfill-ctype does not exist and could not be created.
I then tried the sollution in RuntimeException] vendor does not exist and could not be created
So I did;
Add your user in the www-data group (this action require you to logout and login again)
sudo usermod -a -G www-data `whoami`
Give these permissions to your project
sudo chown -R www-data:www-data /var/www/<project>
sudo chmod -R 774 /var/www/<project>
I skipped the 2nd part that gives rights to /var/www because I'm on a shared server without root userrights.
I got the following message;
No composer.json in current directory, do you want to use the one at /path-to-site? [Y,n]? y
after that got some cache warnings again and the following question;
Cannot create cache directory /home/maikel/.composer/cache/repo/https---repo.packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/maikel/.composer/cache/files/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/maikel/.composer/cache/repo/https---repo.packagist.org/, or directory is not writable. Proceeding without cache
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 6 updates, 0 removals
- Updating symfony/event-dispatcher (v3.4.14 => v3.4.15):
Update failed (Could not delete /path-to-site/vendor/symfony/event-dispatcher/GenericEvent.php: )
Would you like to try reinstalling the package instead [yes]? y
I anwered yes again, then;
- Removing symfony/event-dispatcher (v3.4.14)
[RuntimeException]
Could not delete /path-to-site/vendor/symfony/event-dispatcher/GenericEvent.php:
update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev]
[--lock] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-
progress] [--no-suggest] [--with-dependencies] [--with-all-dependencies]
[-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-
authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--prefer-
stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--]
[<packages>]...
My two questions are;
- Do I really really need composer (with drush)? I rather drop composer or Drupal alltogether
- If I really need it to properly manage updates in the future, how can I configure composer to update, do I need a global configuration?
Thanks a lot in advance If I can update this question with more information/config files please let me know, I'll gladly do, I honestly don't know where to begin.