Questions tagged as ['composer']

Use it for questions about the PHP application library dependency manager (Composer).
Score: 0
Is it possible to use WSL-based Drush on a Windows 10 XAMPP and if so how?
mu flag

I currently use Drupal 9 but concepts about Drupal 10 may be useful.

I use Windows 10 Home with XAMPP and C:/xampp/htdocs is my web application root.

I want to establish a minimal Drupal development environment on my Windows 10 Home instance by installing Composer and then Drush.

I can use WSL to install both Composer and Drush but then a question arises:
If WSL only effects its own Linux environment, ho ...

Score: 1
Uploading local files via composer
bo flag

I'm using composer to manage a Drupal 9 instance. I'm brand new to composer and have no idea what i'm doing. That being said, I've successfully set it up and have used it to install modules and an admin theme. I just purchased a theme and realized that I don't know how how to upload it with composer. For modules and the admin theme I installed, I used composer require drupal/name-of-module(or theme) but ...

Score: 0
liquidcms avatar
Upgrading to Composer 2 blocked by Symfony dependecies
us flag

I have an existing Drupal 8.9.16 site which uses Composer 1 (and Commerce 2.24). I am trying to upgrade to using Composer 2 using this guide:

I have gotten through all the required steps up to the last step of dealing with drupal-scaffold ( ...

Score: -3
pglatz avatar
Upgrading from 8.9.19 to 9 fails because of root composer.json require (^8.8.0)
in flag

My upgrade is failing. I am at 8.9.19 and I used upgrade-status to make sure all my modules are compatible with next major core version. I am following instructions at

When I get to step 3, running composer update, I'm getting a slew of problems of the form

- drupal/core-recommended 9.0.0 requires drupal/core 9 ...
Score: 0
What's the best way to migrate from manual upgrades to composer updates?
cn flag

I have an 8.9.19 installation that I would like to move over to use composer.

What's the best way to migrate the installation to use composer upgrades? Manual installations are becoming a real pain.

Score: 2
Jay Williams avatar
Is there any problem with installing composer globally?
us flag

I have a VPS and will be hosting a mixture of drupal 8 and drupal 9 sites. I need to install composer to manage the sites.

Is there any need to install composer in a project folder or can I just install globally?

Score: 0
Unable to inherit profile
ye flag

I am trying to create a custom installation profile which will use standard as a base profile. So I created the as below:

name: 'Custom profile'
core_version_requirement: '^9'
type: profile
base profile: standard
description: 'The custom Drupal profile for all CMS websites based upon standard.'
  - menu_ui

  - bartik

But I am not getting any modules which ...

Score: 2
Ex0r avatar
Trouble with the upgrade of core 8.9 to 9.2
cn flag

We are in the process of migrating to Drupal 9, and I am having nothing but problems with composer and trying to get Drupal core updated.

I have provided my composer.json file, and a HUGE list of errors it's spitting out at me, and I have absolutely no idea how to fix it.

The command I have been running is composer update

Gathering patches for root package.
No patches supplied.
Loading composer repos ...
Score: 1
Giuseppe avatar
How target specific version of fork based merge request (MR) patch
br flag

I'm upgrading the core from 9.1.7 to 9.2.5, however there's a patch I don't how to upgrade.

This is the relative issue. The file 2897638-48.patch is currently used. The patch's work meanwhile proceed and was integrated in the "fork based merge request (MR)" system.

I opened a issue in the past on the general use of the MR system, read this one and the documentation of Drupal site, so at least I know ho ...

Score: 2
shelane avatar
What is the proper process to customize htaccess files?
cn flag

We have custom redirect links that use the RedirectMatch rules that redirect based on a root path. We'd rather handle these at the web server level rather than using the Redirect module (if it can even do match based rules), so we put these rules in the .htaccess file, e.g.:

RedirectMatch 301 ^/computing/hpc[/]?(.*) https://hpc.our.domain/$1

Since the .htaccess file is updated with a composer in ...

Score: 0
Michael Lechasseur avatar
drupalcommerce/project-base prohibits upgrade to Drupal 9.2.4
fi flag

I'm running into composer errors while trying to update a Drupal Commerce site to Drupal 9.2.4.

I'm not sure how to interpret this output when I try composer prohibits drupal/core 9.2.4


eg: drupal/core 9.2.4 requires twig/twig (^2.12.0) drupalcommerce/project-base - does not require twig/twig (but v1.44.4 is installed)

Not s ...

Score: 0
Dorian Winterfeld avatar
Why is composer deleting and reinstalling core?
ae flag

I am running Drupal 9.2.4 on Lando on Mac Big Sur. When I use composer to install a module it first deletes core.

Removing package drupal/core so that it can be re-installed and re-patched.
 - Removing drupal/core (9.2.4)

Then it reinstalls it.

 - Installing drupal/core (9.2.4): Extracting archive

If the module fails to install, no core!

I think these are the relevant lines from composer.json.

Score: 1
Michael Lechasseur avatar
Should I remove "Commerce Base" from site before an upgrade?
fi flag

The "Upgrade Status" module reports that "Commerce Base" exists in site file structure, but is not installed and suggests removing it. I expect that the Commerce project references those files to work, but I don't know.

Should this project in my composer/json 'requires' list be removed using Composer? "drupalcommerce/commerce_base": "dev-8.x-1.x",

Remove listing in Upgrade Status module report

My original Drupal 8 install was with Composer u ...

Score: 2
Why Can't I Upgrade from 9.2.3 to 9.2.4 Using Composer?
br flag

If I check for outdated artifacts using:

composer outdated "drupal/*"

I can see Core needs updating:

drupal/core                       9.2.3             9.2.4
drupal/core-composer-scaffold     9.2.3             9.2.4
drupal/core-dev                   9.1.5             9.2.4
drupal/core-recommended           9.2.3             9.2.4


However, when I try to update:

composer update drupal/core-reco ...
Score: 0
"PHP Warning: require(drupal.php): failed to open stream"
bj flag

I have created two fresh installations of Drupal, one version 8.9.17 and the other 9.2.3 and have been trying to get the Drupal console to work so that I can generate a module.

I used the following command in Composer and successfully downloaded it.

composer require drupal/console:~1.0 \
--prefer-dist \
--optimize-autoloader \
--sort-packages \

Then run the following to avoid a Symphony confl ...

Score: 0
Composer require installation profile constraint match error
us flag

I am trying to download this install profile

I added it to composer.json like this

"repositories": [
            "type": "composer",
            "url": ""
            "type": "vcs",
            "url": ""

Then I did composer ...

Score: 0
Travis avatar
Cannot update Group module with composer
cn flag

We are using the Group module on our D8 site. We use composer to manage our modules and dependencies. I am somewhat of a composer novice, so it's possible that the solution is right in front of me, but I cannot see it.

The Group module refuses to be updated. It's currently at 1.0, and I'd like to update it to 1.4. I've tried running a simple composer update drupal/group, using --with-dependencies

Score: 0
Hometoy avatar
Composer not updating modules
in flag

I have a Drupal 8.9.16 website and when I try running composer update to update the modules, I get this output

$ composer update
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Package container-interop/container-interop is abandoned, you should av ...
Score: 0
Akshar Vijay avatar
Issues after updating Composer 2
in flag

I have been using drupal for over a month now. I am unable to install modules properly because of the composer 2 updating issues.

So far I have made the following changes while updating composer 2 "oomphinc/composer-installers-extender": "^2", "wikimedia/composer-merge-plugin": "^2", "drupal/core-composer-scaffold": "^8"

When I try composer update I get the following errors

Problem 1
    - acquia/lightnin ...
Score: 0
albertski avatar
Locked to version problem when upgrading
cn flag

Every time I run the composer command to upgrade Drupal 8.9.16 to Drupal 9, it notifies me that there is a problem with a module.

For example, I run:

composer require drupal/core --with-all-dependencies

I get:

Using version ^9.2 for drupal/core
./composer.json has been updated
Running composer update drupal/core --with-all-dependencies
Gathering patches from patch file.
Loading composer repositories ...
Score: 0
Extect avatar
How to update a module in production?
cn flag

I am using git to deploy my composer.lock to production. Contrib is not part of my git repo. Therefore, in production I then run composer install to add contrib to production.

What happens when I update a module in dev via composer update, then deploy the updated composer.lock to production and run composer install there? Will it update/replace the existing module code or what is the best practice ...

Score: 0
dca123 avatar
Warnings after upgrading
cn flag

After upgrading to Drupal 9.2.0 using Composer I sometime get the following error.

Deprecated function: Required parameter $bubbleable_metadata follows optional parameter $data in require_once() (line 276 of core/lib/Drupal/Core/Extension/ModuleHandler.php). require_once() (Line: 276)
Drupal\Core\Extension\ModuleHandler->loadInclude('token', 'inc', 'token.tokens') (Line: 214)
token_module_imp ...

Score: 0
pierostz avatar
Module update with composer, updates module but not really
na flag

I am updating modules on my drupal site and I am using the composer like this:

composer require 'drupal/module'

The output I get from composer looks like everything is working fine but when I go to the update page of the modules nothing seems to change. The output from composer looks like this:

enter image description here

This is an occurence on every module I have.

composer.json :

"name": "drupal/legacy-project",
"descriptio ...
Score: 0
upgrade_status - unexpected error about PHP version
ru flag

I'm doing preparatory work for upgrading a site from D8 to D9...

The Drupal dev site (macOS 10.14.6 served with Laravel Vagrant) is running PHP 7.3.28, both on command line and php-fpm, and I'm seeing the correct version with php --version and at /admin/reports/status

And yet, whenever I scan my custom modules via the upgrade_status UI, I consistently get:

PHPStan command failed:

/Users/wt/Sites/sitename ...
Score: 2
Giuseppe avatar
How do I apply patches from a merge request?
br flag

I used the patch #48 of Views exposed sort identifiers are not configurable. I need to update the core, and apply the latest rebased version of that.

However, the issue hasn't be marked Fixed, and I don't see any "patch file" to link in my composer.json.

How can achieve this?

Score: 1
mathieu avatar
How do I avoid overwriting the .htaccess file when I use the Compose command?
mw flag

On my new Drupal 9 website, I customized the .htaccess file and the robots.txt file

I don't want its files to be overwritten when updating with Composer.

I added the lines below in my composer.json file but the .htassess file is overwritten every time. What's wrong with my code ? Thank you

"extra": {
    "drupal-scaffold": {
        "locations": {
            "web-root": "./"
        "file-mapp ...