29
votes
Accepted
How can I force Composer to install a dev branch over a stable release?
While it will install the latest dev release of the Drupal module/theme to simply do the following:
composer require drupal/bootstrap:3.x-dev
I would argue a best practice when installing a dev ...
29
votes
Accepted
Composer keeps overwriting .htaccess (and other files) every time I do anything
That's Drupal's Composer Scaffold. Listed as "drupal/core-composer-scaffold": "^8.8.0" or a different version in your project's composer.json file.
To prevent certain scaffold files from being ...
26
votes
"Uncaught ReflectionException: Class DOMDocument does not exist" error
DOMDocument is included in the extension php-xml. To install it on ubuntu, run:
sudo apt-get install php-xml
24
votes
Accepted
composer require fails because it can't delete default.services.yml
Make your "local" machine work as intended, and maintain the security of your live site.
Since you want to use composer require command only on non-production environments, the following ...
22
votes
Accepted
Is Drush abandoned?
You have installed the development master branch of Drush. To continue using commands such as drush dl, drush pm-update and so on, you should install the 8.x branch of Drush.
However, your basic ...
18
votes
Accepted
Require v8 only contrib module with v9 patch
Drupal 10
As reported by @rocketeerbkw, the official lenient endpoint in packagist currently doesn't support Drupal 10.
https://github.com/mglaman/composer-drupal-lenient does.
Instructions for use ...
17
votes
Accepted
Trouble after updating to 2.0
In order to resolve the composer/installers ^1.7 issue you can require composer/installers ^1.9. More details can be found from Drupal's Preparing your site for Composer 2.
composer require "...
16
votes
How can I force Composer to install a dev branch over a stable release?
You can keep the original prefer-stable settings. The @dev in 8.3.*@dev is the stability flag for the given package. The easiest way to force a dev-version of a package is to use a different version ...
16
votes
Accepted
How to add JavaScript or CSS library to Composer project?
The library can be installed into a custom path by utilizing extra : installer-paths to for e.g.:
web/sites/libraries/{$name}
Additional to that, we define the required package repository with the ...
16
votes
How do I uninstall Drush?
You can use composer global remove drush/drush to uninstall a global Drush.
Or use composer remove drush/drush to uninstall a project-local Drush.
16
votes
Accepted
Installation error with Composer
Please make sure your webserver (nginx/apache) is using the same PHP version as your cli one. For example, you may encounter this issue if your cli PHP version is PHP 7.1 and your webserver is using ...
15
votes
Accepted
Composer updates .htaccess file when updating
"extra": {
"drupal-scaffold": {
"source": "http://cgit.drupalcode.org/drupal/plain/{path}?h={version}",
"excludes": [ ".htaccess", "robots.txt" ]
}
}
Put this above code in ...
15
votes
How do I apply a patch with Composer workflow?
First, run
composer require cweagans/composer-patches
Now you have a package installed that enables you to patch core, libraries or modules.
Second, add a patch to a folder named 'patches' in the ...
15
votes
composer require fails because it can't delete default.services.yml
This command will fix it temporarily:
chmod u+w web/sites/default
But Drupal will harden permission again soon. To turn it off add this to settings.php:
$settings['skip_permissions_hardening'] = TRUE;...
15
votes
Accepted
How do I apply patches from a merge request?
If you look into the Issue queue you can see MR #54 is the latest code change.
Go to the URL of the MR and add .patch at the end of the URL you will get the path to the latest patch.
URL for your ...
15
votes
Composer not applying patch: exceeded the timeout of 300 seconds
Thanks @cilefen for pointing me in the right direction. For me solution 423 of this thread fixed the problem: https://github.com/cweagans/composer-patches/issues/423#issuecomment-1301026697
The ...
14
votes
Drush CC all returning "No Drupal site found, only 'drush' cache was cleared"
There are a few things you can do to help debug your drush. Here is what you can try:
Debug output
Use drush cc all -vvv
This will provide you with some valuable information in terms of what Drush ...
14
votes
Accepted
Error when attempting to create sync directory
Nothing wrong with that.
It is recommend to have the config folder outside of the public web folder; Drupal just doesn't have that. To keep the installation simple for non-experienced users, it puts ...
14
votes
How can I install a beta version of a module?
This installs the latest beta-12 for me:
composer require drupal/webform:5.0.*@dev
You need to do a bit of translation from the Drupal version number. From Using Composer to manage Drupal site ...
14
votes
Accepted
How to install multiple modules with composer at once?
You can write the names of multiple packages separated by spaces. For example:
composer require drupal/adminimal_theme:^1.5 drupal/adminimal_admin_toolbar:^1.9
13
votes
Accepted
drupal/core vs. drupal/core-recommended
It's "core-recommended" as in "recommended to avoid having dependency-related trouble with core."
Drupal core (and some of the contributed modules, but not all) has a variety of ...
12
votes
Accepted
Updating Drush with Composer
If you want to update your global installations of any package under composer, you can just do this:
composer global update
You don't need to navigate to .composer/vendor/drush/drush
However: There ...
12
votes
Accepted
How to install with composer external library that drupal module depends on
You should be able to include this package via composer by adding some repository info.
Add a package definition to your repositories section in your composer.json. The resulting repositories section ...
12
votes
Accepted
`composer require` fails because "Source directory docroot/core has uncommitted changes"
Explanation: The problem is that cweagans/composer-patches is applying patches to Drupal Core after cloning it, leading Composer to believe you've modified the affected files and therefore to prompt ...
12
votes
Accepted
Command to install Drupal 9 with Composer
create-project can take a version number, and recommended-project has some tags in for 9.x, so for example:
composer create-project drupal/recommended-project mynewproject "9.0-beta1"
Or if you just ...
11
votes
Accepted
How to download a module hosted on GitHub via composer.json?
You need Composer Installers for that:
{
"name": "my-project",
"type": "project",
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal....
10
votes
How do I update core with Composer?
To update Drupal using Composer, you just need to move the "drupal/core": "~8.1" line from the replace section to the require section. At the end the content of the composer.json file is like the ...
10
votes
How do I apply a patch with Composer workflow?
The issue is that composer is applying patches using git apply which is not working for packages that are not installed from source.
Therefore the solution is to install the packages from source. ...
10
votes
Accepted
Move my project from public_html/web to public_html
You should be able to change the installer paths in composer.json, which defines where the files are placed:
"installer-paths": {
"web/core": ["type:drupal-core"],
"web/modules/contrib/{$name}": [...
10
votes
composer update drupal/drupal does not work : Nothing to install or update
Finally, i could update with these modifications.
Step 1, optional in case your composer.jsoncontains this. If it is ok, apply step 2
add
"require": {
---
"drupal/core": "~8.5"
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
composer × 6058 × 278
drush × 102
updating × 66
9 × 48
installation × 47
7 × 22
version-control × 17
commerce × 16
upgrading × 16
theming × 15
10 × 13
webforms × 10
configuration × 6
deployment × 6
.htaccess × 5
community-official-site × 5
migrations × 4
console × 4
distributions × 3
acquia-dev-desktop × 3
javascript × 2
search × 2
acquia-cloud × 2
installation-profiles × 2