Using composer with Drupal ( 8 & 9), composer require drupal/<package-name>
returns the following error.
Installation failed, reverting ./composer.json to its original content.
[RuntimeException]
Could not delete web/sites/default/default.services.yml
Since you want to use composer require
command only on non-production environments, the following steps affect only on the machines you deliberately set up. Drupal’s recommended configuration will be preserved on all other machines, including production servers.
Steps
- enable settings.local.php (here are the instructions from the docblock in settings.local.php):
* To activate this feature, copy and rename it such that its path plus * filename is 'sites/default/settings.local.php'. Then, go to the bottom of * 'sites/default/settings.php' and uncomment the commented lines that mention * 'settings.local.php'. * * If you are using a site name in the path [... read about exceptions in file]
- set file permissions to allow user and group to write to the file on your local machine:
$ chmod ug+w {name_of_docroot}/sites/default
Similar Posts:
- How to change Drupal core files
- install drupal 8 with composer
- Install Drupal 8 via composer
- change canonical URL in drupal 8 & 9
- how to redirect to https in drupal 8 / 9
975