
Working with Drupal 8 and Commerce 2 requires sites to be built using composer, a PHP dependency manager.
Composer is a fantastic tool for managing code and the ever-growing mesh of dependencies which form the backbone of modern websites. However, it can be a royal *headache* when it won't behave!
We recently had a requirement to switch a Commerce 2 site from the stable code branch to the 2.x-dev branch - and found a bunch of problems stopping us from doing that. The essence of the problem is that everything is dependent on everything else, so in order to make the shift, you have to change all the dependent items at the same time.
Running
composer require drupal/commerce 2.x-dev
on its own will not work, but the following recipe did work for us
composer require drupal/commerce 2.x-dev drupal/commerce_cart 2.x-dev drupal/commerce_checkout 2.x-dev drupal/commerce_order 2.x-dev drupal/commerce_payment 2.x-dev drupal/commerce_payment_example 2.x-dev drupal/commerce_price 2.x-dev drupal/commerce_product 2.x-dev drupal/commerce_promotion 2.x-dev drupal/commerce_store 2.x-dev drupal/commerce_tax 2.x-dev
You may have further dependencies to include, but this at least gives you the format.