Questions tagged [composer]
Use it for questions about the PHP application library dependency manager (Composer).
82
questions
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 ...
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 ...
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?
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 ...
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 ...
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?
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 ...
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.
[...
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 ...
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 ...
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. ...
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 ...
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 ...
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.
...
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 ...
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 ...
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 ...
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?
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:
...
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:
...
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": "...
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 ...
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 ...
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 ...
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:
...
-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-...
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....
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. ...
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, ...
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 ...
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....
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 ...
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 ...
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":...
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 ...
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 ...
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\...
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 ...
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' ...
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 ...
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 ...
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. ...
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 ...
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 ...
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 ...
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 ...
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/...
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 ...
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 ...
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 ...