Questions tagged [composer]

Use it for questions about the PHP application library dependency manager (Composer).

Filter by
Sorted by
Tagged with
14 votes
3 answers
2k views

Require v8 only contrib module with v9 patch

Given I have Drupal 9 composer installation with composer-patches plugin and given a contrib module with a stable v8 release, but no v9 release (not even dev branch) and given that contrib module has ...
Hudri's user avatar
  • 5,311
17 votes
5 answers
7k views

What is the correct core update workflow?

I want to use composer to manage Drupal 8 dependencies, but I'm not sure what is the right core update workflow. At the moment I'm using drush to update core to latest beta release, but I also have ...
rreiss's user avatar
  • 969
17 votes
2 answers
47k views

How do I uninstall Drush?

There is a method of installing Drush via Composer. composer global require drush/drush:dev-master How do I uninstall it using Composer?
kenorb's user avatar
  • 14.1k
13 votes
3 answers
30k views

How do I apply a patch with Composer workflow?

I need to include a patch in my project. I have included cweagans/composer-patches in composer.json and added the following lines in the extra section (example is from when trying to enable ...
Thomas Pappas's user avatar
10 votes
1 answer
5k views

Managing module library dependencies with composer

I've found Dependencies in a custom module with drupal-composer, How can I include a third party library in my custom module without using Composer Manager and How to manage contrib modules composer ...
Neograph734's user avatar
  • 8,379
7 votes
2 answers
3k views

How to patch your htaccess file correctly in composer.json

After running composer update my Drupal installation gets updated, but it also changes the content of the .htaccess file each time. How can I correctly patch it?
Stef Van Looveren's user avatar
7 votes
3 answers
9k views

Undefined error: 0 OR Unable to load autoload.php. Drush now requires Composer

I've installed drush in /usr/local/lib/drush/drush and composer in /usr/local/bin/composer. When I try to run drush /usr/local/lib/drush/drush I get the following: /usr/local/lib/drush/drush: line ...
radishred's user avatar
14 votes
4 answers
19k views

composer require fails because it can't delete default.services.yml

Using composer with Drupal (7, 8 & 9), composer require drupal/<package-name> returns the following error. Installation failed, reverting ./composer.json to its original content. [...
Kay V's user avatar
  • 638
12 votes
11 answers
12k views

Drush CC all returning "No Drupal site found, only 'drush' cache was cleared"

I've tried other solutions, but none of them are specific to my setup. I just started using the new Linux subsystem featured in the recent Windows 10 update. I'm using WAMP x64 v3.0.6, and have ...
Kellen's user avatar
  • 457
10 votes
4 answers
5k views

Why doesn't "composer update drupal/drupal" work?

I installed a Drupal 8.2.0 site with composer create-project drupal/drupal testsite. Now I would like to upgrade it to Drupal 8.2.1. However, running composer update drupal/drupal doesn't work. It ...
Christoph Burschka's user avatar
4 votes
3 answers
15k views

Updating Drush with Composer

I've been using Drupal for several years, but only just dipping a toe in with Drush - I've bought an ebook tutorial and working my way through. I've installed Composer, and used it to install Drush. ...
iain-g's user avatar
  • 199
1 vote
2 answers
501 views

8.5.6 Update not being recognized

I converted a Drupal 7.xx site to Drupal 8.x manually. Updated it to 8.4.5 and tried to use composer to update it to 8.5.6 (Latest stable release). I have the original site as the public_html/drupal ...
Whitekn3's user avatar
0 votes
1 answer
1k views

How do I update core to 8.5?

After I realized that the thing I mostly enjoyed using Drupal for the last 10 years, Drush, is being axed, I started to set up all new Drupal sites with Composer. Unfortunately I can't update core as ...
user5950's user avatar
  • 2,018
11 votes
2 answers
671 views

Patch drupal.org project (core/module/theme) with issue fork

The new fork based merge request (MR) approach is pretty neat to get the patches created/reviewed/merged. However, if you are using the patch via cweagans/composer-patches, we have a few options. ...
vijaycs85's user avatar
  • 2,384
8 votes
1 answer
4k views

how to install package via composer?

I would like to add library to my drupal 7 custom module. Library can be installed via composer, but i can't find a solution for install? How can i install this library? I have installed "composer ...
gregab's user avatar
  • 507
8 votes
1 answer
3k views

Is Drush abandoned?

I installed Drush via Composer (like the Drush site recommends). Every time I run drush dl drupal-7.x, I get a message telling me that I should use Composer. [notice] dl has been deprecated. Please ...
doub1ejack's user avatar
8 votes
0 answers
3k views

How do I update Drupal core on composer install? [duplicate]

I installed (or downloaded) drupal 8 via: composer create-project drupal/drupal my_site_name 8.0.* Which, at the time I ran it, downloaded Drupal 8.0.1. Now drupal 8.0.2 is available and I'd like ...
User's user avatar
  • 1,723
7 votes
3 answers
2k views

Composer updates .htaccess file when updating

I am using composer with Drupal lightning. If I update Drupal via composer, it updates the .htaccess file. Is there any way to prevent the .htaccess file from being overwritten?
albertski's user avatar
  • 3,447
7 votes
2 answers
10k views

Installing Bootstrap theme using Composer

I am new to using Composer. How can I install a theme, say https://www.drupal.org/project/bootstrap using composer I've tried: composer require drupal/bootstrap But didn't work. I also tried: ...
Bishoy's user avatar
  • 315
4 votes
2 answers
1k views

Composer installing dev modules getting Authentication required (git.drupalcode.org) [closed]

When trying to composer install, and it reaches one of the modules using a Dev version, I get: - Installing drupal/paragraphs (dev-1.x 42842d5): Authentication required (git.drupalcode.org): Username: ...
MetalBearSolid's user avatar
3 votes
1 answer
3k views

How to update 8.0.x to 8.1.x with composer?

This is excerpt from my composer.json file (trimmed for readability). It was created by running composer create-project drupal/drupal my_site_name 8.0.* as described on drupal.org: { "name": "...
SiliconMind's user avatar
  • 3,151
2 votes
2 answers
507 views

Third-party modules installed with Composer don't have their version in the .info.yml file

I have a project installed by composer, everything working perfectly, except when i run composer install contrib module installed successfully in web/modules/contrib but none of the modules .info.yml ...
berramou's user avatar
  • 7,085
2 votes
1 answer
1k views

How can I include a third party library in my custom module without using Composer Manager

I'm trying to create a custom Twitter Pull module in Drupal 8. I would like to include https://github.com/abraham/twitteroauth. I can't seem to get it working adding it via composer in the root ...
Greg's user avatar
  • 832
1 vote
1 answer
1k views

Converting a drupal/drupal site to Work With Composer

At our company we have several sites that appear to have been made using the now deprecated method of composer create-project drupal/drupal. We've been fine using previously documented methods to ...
Aaron Chamberlain's user avatar
0 votes
1 answer
771 views

Updating core from 8.4.4 to 8.6.1

I want to update Drupal from 8.4.4 to 8.6.1. I've tried to follow the steps from this page, but without success. When I run this command: composer update drupal/core --with-dependencies I get: ...
briast's user avatar
  • 632
-2 votes
1 answer
849 views

How do I update from 9.0.10 to 9.1.0?

I have tried to update drupal 9.0.10 to 9.1 with composer but I cannot: composer outdated 'drupal/*' drupal/core 9.0.10 **9.1.0** Drupal is an open source content manage... drupal/core-...
user101999's user avatar
20 votes
2 answers
42k views

How can I force Composer to install a dev branch over a stable release?

I am experimenting with Bootstrap 3 in Drupal 8 and I want to stay on the dev branch of bootstrap. In my composer.json, I wrote the following line based on Drupal Packagist: "drupal/bootstrap": "8.3....
Patrick Kenny's user avatar
15 votes
1 answer
5k views

Composer keeps overwriting .htaccess (and other files) every time I do anything

Every time I try to update anything using Composer, it overwrites a load of files. One of the files it overwrites is .htaccess, which I have customised, so I have to keep patching it all the time. ...
naomi's user avatar
  • 1,165
10 votes
1 answer
6k views

How do I update core with Composer?

Ok, admittedly I'm a composer novice. So, in my previous site, I used composer manager to update Drupal's core. That was pretty straight forward to use (just run "composer drupal-update"). However, ...
DrupalMonster's user avatar
9 votes
2 answers
3k views

Disabling module with config sync and removing with composer

I have an issue disabling modules, I've searched but cannot find something useful: - Developer A disable module and via composer remove it - I pull his changes so i run composer install that remove ...
Francesco's user avatar
  • 123
8 votes
1 answer
4k views

How to download a module hosted on GitHub via composer.json?

I've got the following composer.json file: { "name": "my-project", "type": "project", "repositories": [ { "type": "composer", "url": "https://packages....
kenorb's user avatar
  • 14.1k
8 votes
2 answers
990 views

How do I include composer.libraries.json in root composer.json without using the wikimedia/composer-merge-plugin plugin?

In the recent update to Composer 2.0 the advice is to get rid of the wikimedia/composer-merge-plugin, which was even removed from the dependencies of Drupal core. There is documentation on how to ...
Koen Strien's user avatar
7 votes
1 answer
3k views

Loading dependencies from the vendor directory in a module using composer

I am using composer for managing dependencies in my drupal module. I specified my dependency in the composer.json file placed in my module's root directory. After running the composer install comand ...
crzpiot's user avatar
  • 434
7 votes
1 answer
3k views

Composer is git cloning modules instead of download them?

My composer file looks as follows: { "name": "drupal/drupal", "description": "Drupal is an open source content management platform powering millions of websites and applications.", "type":...
Kevin's user avatar
  • 27.7k
7 votes
1 answer
2k views

How to manage contrib modules composer dependencies on drupal 8

Let's say I have a module exposing a composer.json file, composer manager let me merge it with others modules composer.json. In Drupal 8 composer.json are used from the core, so is it possible to ...
B2F's user avatar
  • 937
6 votes
1 answer
605 views

What is the difference between drupal/drupal and drupal-composer/drupal-project packages?

I want to use composer with my future Drupal projects. I installed Composer on my machine and I noticed two packages (drupal/drupal and drupal-composer/drupal-project). When I install the second ...
learner123's user avatar
6 votes
1 answer
591 views

"Declaration of <function> must be compatible with <interface>" in Drupal 8.6.10

Up until Saturday I had a functioning Drupal 8.6.x instance. The I did composer update and Drupal 8.6.10 was installed. Since then I get the following in my error logs: Declaration of Drupal\Core\...
Stephen Winnall's user avatar
5 votes
2 answers
8k views

composer update drupal/drupal does not work : Nothing to install or update

I’ve installed several Drupal 8 site with composer as it is strongly recommended. I can update modules like this : composer require drupal/pathauto:1.1 But I can't update core with composer ...
Sébastien Gicquel's user avatar
5 votes
4 answers
5k views

No Drupal Site Found when clearing cache [duplicate]

I installed drush using composer following the instructions here: http://docs.drush.org/en/master/install/ When trying to run drush cc all I get this error: No Drupal site found, only 'drush' ...
srodrig's user avatar
  • 145
5 votes
2 answers
2k views

How can I require a custom module hosted elsewhere with its contrib dependencies being downloaded too?

Hi I am trying to setup my new Drupal 8 site with composer, but I got few issues. I tried to setup the site site by following the Guide from here and was able to setup the site successfully. After ...
miststudent2011's user avatar
5 votes
3 answers
2k views

Drush on production server without Composer

I want Drush 9 on a Drupal 8 production server without having to install Composer. Is there any way to do this? And if that is not possible, can anyone suggest an alternative to Drush especially for ...
tanbog's user avatar
  • 1,243
4 votes
2 answers
21k views

How can I downgrade a module with Composer?

I updated the following module to its stable version : https://www.drupal.org/project/commerce_pricelist/releases/8.x-2.0-rc2 This module completely broke my site. There has been no database update. ...
fire's user avatar
  • 77
4 votes
2 answers
5k views

How to add JavaScript or CSS library to Composer project?

For some cases, there is the need to add a JavaScript or CSS package to a project. One of those cases was the DropzoneJS package for the drupal/entity_browser. All recommendations I could read online ...
kaiser's user avatar
  • 301
4 votes
2 answers
2k views

How to manage patches in composer when they're merged into the module?

I'm building a Lightning BLT project and recently the deploy:build failed because the features module merged a patch composer.json was set to apply. Is there a way to indicate to composer that the ...
ponies's user avatar
  • 542
4 votes
2 answers
8k views

How to install drush 8 properly on Debian 8?

Finding hundreds of articles and documents about how to install drush and none of it explains where exactly and how properly I got a bit lost. I've got a Debian 8 system with a root user, NGinx and a ...
Chris's user avatar
  • 277
4 votes
2 answers
3k views

Where should I download libraries for modules through composer?

I've started to use Drupal 8 and some modules requires some libraries. For example search api solr. When I'm installing these libraries via composer it downloads the libraries into directory of the ...
Eugene's user avatar
  • 2,429
4 votes
1 answer
2k views

Cannot do a `composer install` even though my minimum stability is listed as dev

I am trying to build the master branch in my project after updating to 8.5.0, but am being met with an error from composer (which I did not get on my develop branch): The requested package drupal/...
Kevin's user avatar
  • 27.7k
4 votes
4 answers
2k views

How to remove subdir from base URL after installing site with Composer on a shared host?

I've managed to install drupal 8 using composer and following script: composer create-project drupal-composer/drupal-project:8.x-dev my_site_name_dir --stability dev --no-interaction I decided to ...
TobiasAldgard's user avatar
3 votes
1 answer
116 views

How to do core development with composer-based install?

I'm using drupal-composer/drupal-project. With that, installer-paths in composer.json installs core in web/core, it doesn't clone a full git repository. I'd like a full repository, so I can reroll ...
William Turrell's user avatar
3 votes
1 answer
956 views

Composer require drupal/ packages doesn't work

If I run... composer require drupal/token ...I get... Could not find a version of package drupal/token matching your minimum-stab ility (dev). Require it with an explicit version constraint ...
arnoldbird's user avatar
  • 1,079