I started from scratch for a new site, using Composer for all of it. Drupal core is at 8.3.7, and Commerce is at 2.0-RC1 (because those were the levels of another site that I was having trouble with that I needed to correct). All is working well.
In another post over on Drupal.org someone advised me not to make updates of Commerce that jump more than one release. So I planned to go to RC2, then RC3, then the move to 8.4 and the full 2.0 version of Commerce.
Try as I might, I cannot get any type of Commerce upgrade to work (I'm still staying at Core 8.3.7 for the time being) - either to RC2, RC3 or 2.0. I've tried every possible permutation of update and require, specifying the product as simply drupal/commerce and drupal/commerce:2.0-rc2, leaving the rest of the command blank or using --with-dependencies
or --update-with-dependencies
, etc.
No matter what I do, it keeps telling me that drupal/commerce_price is locked at 2.0.0-rc1, or that there is nothing to do.
For example, when I run composer require "drupal/commerce:2.0-rc2" --update-with-dependencies
, I get:
./composer.json has been updated
Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages.Problem 1
- drupal/commerce_price 2.0.0-rc1 requires drupal/commerce 2.0.0-rc1 -> satisfiable by drupal/commerce[2.0.0-rc1] but these conflict with your requirements or minimum-stability.
- drupal/commerce_price 2.0.0-rc1 requires drupal/commerce 2.0.0-rc1 -> satisfiable by drupal/commerce[2.0.0-rc1] but these conflict with your requirements or minimum-stability.
- drupal/commerce_price 2.0.0-rc1 requires drupal/commerce 2.0.0-rc1 -> satisfiable by drupal/commerce[2.0.0-rc1] but these conflict with your requirements or minimum-stability.
- Installation request for drupal/commerce_price (locked at 2.0.0-rc1) -> satisfiable by drupal/commerce_price[2.0.0-rc1].
If I run composer update drupal/commerce --with-dependencies
, I get:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
Drupal\Core\Composer\Composer::preAutoloadDump
Drupal\Core\Composer\Composer::ensureHtaccess
When I try composer require drupal/commerce --update-with-dependencies
, I get:
Using version ^2.0 for drupal/commerce
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Writing lock file
Generating autoload files
Drupal\Core\Composer\Composer::preAutoloadDump
Drupal\Core\Composer\Composer::ensureHtaccess
These are the commerce-related entries returned from composer outdated
.
drupal/commerce 2.0.0-rc1 2.0.0 > Drupal Commerce is a flexible eCommerce solution. drupal/commerce_order 2.0.0-rc1 2.0.0 > Defines the Order entity and associated features. drupal/commerce_payment 2.0.0-rc1 2.0.0 > Provides payment functionality. drupal/commerce_price 2.0.0-rc1 2.0.0 > Defines the Currency entity. drupal/commerce_store 2.0.0-rc1 2.0.0 > Defines the Store entity and associated features.
So there is work to be done. Why won't Composer allow me to make to upgrades?
To provide a little more information, this is the main part of the composer.json file.
"require": {
"composer/installers": "^1.0.24",
"wikimedia/composer-merge-plugin": "~1.4",
"drush/drush": "^8.1",
"drupal/ctools": "^3.0",
"drupal/embed": "^1.0",
"drupal/token": "^1.0",
"drupal/addtoany": "^1.8",
"drupal/admin_toolbar": "^1.20",
"drupal/admin_toolbar_tools": "^1.20",
"drupal/back_to_top": "1.x-dev",
"drupal/contact_block": "^1.4",
"drupal/contact_storage": "1.x-dev",
"drupal/copyright_block": "1.x-dev",
"drupal/ds": "^3.1",
"drupal/entity_browser": "^1.3",
"drupal/entity_embed": "1.x-dev",
"drupal/honeypot": "^1.27",
"drupal/social_media_links": "^2.5",
"drupal/textarea_widget_for_text": "^1.0",
"drupal/video_embed_field": "^1.5",
"drupal/webform": "5.x-dev",
"drupal/panelbutton": "^1.1",
"drupal/colorbutton": "^1.1",
"drupal/ckeditor_font": "^1.0",
"drupal/google_analytics": "^2.2",
"drupal/google_analytics_reports": "3.x-dev",
"drupal/metatag": "^1.3",
"drupal/pathauto": "^1.0",
"drupal/redirect": "1.x-dev",
"drupal/sitemap": "^1.3",
"drupal/w3c_validator": "^1.3",
"drupal/commerce": "^2.0",
"drupal/search_api": "^1.5",
"drupal/commerce_authnet": "1.x-dev",
"drupal/commerce_paypal": "1.x-dev"
},
"replace": {
"drupal/core": "~8.3"
}
Note that the entry for drupal/commerce has been added after I ran the commands listed above. I checked my archive and its value started out as "drupal/commerce": "2.0-rc1"
.
These are parts of the composer.lock file after I ran those commands.
"name": "drupal/commerce_store",
"version": "2.0.0-rc1",
"require": {
"drupal/commerce": "self.version",
"drupal/commerce_price": "*",
"drupal/core": "*"
},
"type": "metapackage",
"extra": {
"branch-alias": {
"dev-2.x": "2.x-dev"
},
"drupal": {
"version": "8.x-2.0-rc1",
"datestamp": "1504208045",
"security-coverage": {
"status": "not-covered",
"message": "RC releases are not covered by Drupal security advisories."
}
}
},
"name": "drupal/commerce",
"version": "2.0.0-rc1",
"source": {
"type": "git",
"url": "https://git.drupal.org/project/commerce",
"reference": "8.x-2.0-rc1"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/commerce-8.x-2.0-rc1.zip",
"reference": "8.x-2.0-rc1",
"shasum": "e82857cd23c7eebe32a7fa14002d7ab2156dc0a6"
},
"require": {
"commerceguys/intl": "~0.7",
"drupal/address": "~1.0",
"drupal/core": "~8.3",
"drupal/entity": "~1.0",
"drupal/entity_reference_revisions": "~1.0",
"drupal/inline_entity_form": "~1.0",
"drupal/profile": "~1.0",
"drupal/state_machine": "~1.0",
"ext-bcmath": "*"
},
"require-dev": {
"drupal/commerce_cart": "*",
"drupal/commerce_order": "*",
"drupal/commerce_payment": "*",
"drupal/commerce_price": "*",
"drupal/commerce_product": "*",
"drupal/commerce_store": "*",
"drupal/entity_reference_revisions": "*",
"drupal/inline_entity_form": "*",
"drupal/profile": "*",
"drupal/state_machine": "*"
},
"type": "drupal-module",
"extra": {
"branch-alias": {
"dev-2.x": "2.x-dev"
},
"drupal": {
"version": "8.x-2.0-rc1",
"datestamp": "1504208045",
"security-coverage": {
"status": "not-covered",
"message": "RC releases are not covered by Drupal security advisories."
}
}
"name": "drupal/commerce_order",
"version": "2.0.0-rc1",
"require": {
"drupal/commerce": "self.version",
"drupal/commerce_price": "*",
"drupal/commerce_store": "*",
"drupal/core": "*",
"drupal/entity_reference_revisions": "*",
"drupal/profile": "*",
"drupal/state_machine": "*"
},
"type": "metapackage",
"extra": {
"branch-alias": {
"dev-2.x": "2.x-dev"
},
"drupal": {
"version": "8.x-2.0-rc1",
"datestamp": "1504208045",
"security-coverage": {
"status": "not-covered",
"message": "RC releases are not covered by Drupal security advisories."
"name": "drupal/commerce_price",
"version": "2.0.0-rc1",
"require": {
"drupal/commerce": "self.version",
"drupal/core": "~8.0"
},
"type": "metapackage",
"extra": {
"branch-alias": {
"dev-2.x": "2.x-dev"
},
"drupal": {
"version": "8.x-2.0-rc1",
"datestamp": "1504208045",
"security-coverage": {
"status": "not-covered",
"message": "RC releases are not covered by Drupal security advisories."
}
}
"name": "drupal/commerce_store",
"version": "2.0.0-rc1",
"require": {
"drupal/commerce": "self.version",
"drupal/commerce_price": "*",
"drupal/core": "*"
},
"type": "metapackage",
"extra": {
"branch-alias": {
"dev-2.x": "2.x-dev"
},
"drupal": {
"version": "8.x-2.0-rc1",
"datestamp": "1504208045",
"security-coverage": {
"status": "not-covered",
"message": "RC releases are not covered by Drupal security advisories."
}
}
composer.lock
, delete/vendor
, and delete any other directories that are automatically created by composer. (Make a backup first if you don't have one.) Then runcomposer install
from the empty repo state; this can sometimes fix dependency problems when there is a problem such as the one you describe.