After hours of struggling to update Drupal with Composer (see my solution here), I have now some difficulties to update some modules. I was able to update with composer update drupal/bootstrap:3.11 --with-dependencies
, but I could not update a module with composer update drupal/pathauto:1.1 --with-dependencies
, which returns the following error.
Package "drupal/pathauto:1.1" listed for update is not installed.
Ignoring. Nothing to install or update.
The content of the composer.json file is the following.
{
"name": "drupal/drupal",
"description": "Drupal is an open source content management platform powering millions of websites and applications.",
"type": "project",
"license": "GPL-2.0+",
"require": {
"composer/installers": "^1.0.24",
"wikimedia/composer-merge-plugin": "^1.4",
"drupal/views_slideshow": "^4.6",
"drupal/metatag": "^1.4",
"drush/drush": "dev-master",
"drupal/core": "~8.5",
"drupal/pathauto": "1.1",
"drupal/bootstrap": "3.11",
"drupal/token": "1.1"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"preferred-install": "dist",
"autoloader-suffix": "Drupal8"
},
"extra": {
"_readme": [
"By default Drupal loads the autoloader from ./vendor/autoload.php.",
"To change the autoloader you can edit ./autoload.php.",
"This file specifies the packages.drupal.org repository.",
"You can read more about this composer repository at:",
"https://www.drupal.org/node/2718229"
],
"merge-plugin": {
"include": [
"core/composer.json"
],
"recurse": false,
"replace": false,
"merge-extra": false
},
"installer-paths": {
"core": ["type:drupal-core"],
"modules/contrib/{$name}": ["type:drupal-module"],
"profiles/contrib/{$name}": ["type:drupal-profile"],
"themes/contrib/{$name}": ["type:drupal-theme"],
"drush/contrib/{$name}": ["type:drupal-drush"],
"modules/custom/{$name}": ["type:drupal-custom-module"],
"themes/custom/{$name}": ["type:drupal-custom-theme"]
}
},
"autoload": {
"psr-4": {
"Drupal\\Core\\Composer\\": "core/lib/Drupal/Core/Composer"
}
},
"scripts": {
"pre-autoload-dump": "Drupal\\Core\\Composer\\Composer::preAutoloadDump",
"post-autoload-dump": [
"Drupal\\Core\\Composer\\Composer::ensureHtaccess"
],
"post-package-install": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup",
"post-package-update": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup"
},
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
}
]
}
I tried with composer update drupal/token
, but it gives the following error.
Nothing to install or update
composer install drupal/token
gives the following error.
Invalid argument drupal/token.
Use "composer require drupal/token" instead to add packages to your composer.json.
Instead, composer require drupal/token
gives this error
Using version ^1.1 for drupal/token
./composer.json has been updated Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
I checked the composer.lock file and its content is the following.
"name": "drupal/token",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://git.drupal.org/project/token",
"reference": "8.x-1.1"
},
So, it seems thats it is correct, but the module page still shows it as requiring to be updated.
How can I solve this and install these modules?
composer update drupal/token
(drop the version) maybe? I’ve never seen an example of an update which includes the version, thats generally the point of the version in composer.json. Beyond that check composer.lock - does composer definitely believe that package is installed? Maybe your previous solution, which looks heavy-handed, nuked something important.composer install drupal/token
might be enough to sync things back up againtoken.info.yml
isversion: '8.x-1.0'
so physically the module is not updated. I will continue pushing on this issue. Thank you anyway for your help.