Questions tagged as ['composer']

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 ...

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 ...
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: https://www.drupal.org/docs/develop/using-composer/preparing-your-site-for-composer-2.
I have gotten through all the required steps up to the last step of dealing with drupal-scaffold (https://www.drupal.org/docs/develop/using-composer/using-drupals-composer-s ...
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 https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-8-to-drupal-9-or-later
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 ...

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.
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?

I am trying to create a custom installation profile which will use standard as a base profile. So I created the customprofile.info.yml 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.'
install:
- menu_ui
themes:
- bartik
But I am not getting any modules which ...
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 ...
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 ...
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 ...
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
results: https://pastebin.com/EWaDQejD
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 ...
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.
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",
My original Drupal 8 install was with Composer u ...

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 ...

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 \
--no-update
Then run the following to avoid a Symphony confl ...

I am trying to download this install profile https://github.com/UH-StudentServices/student_guide
I added it to composer.json like this
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
},
{
"type": "vcs",
"url": "git@github.com:UH-StudentServices/student_guide.git"
}
],
Then I did composer ...
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
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 ...
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 ...
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 ...
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 ...
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 ...
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:
This is an occurence on every module I have.
composer.json :
{
"name": "drupal/legacy-project",
"descriptio ...

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 ...
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?
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 ...