Drupal 9 安裝 commerce 筆記

直接執行 composer require drupal/commerce

會出現下面的錯誤訊息

Do not run Composer as root/super user! See https://getcomposer.org/root for details

Using version ^2.24 for drupal/commerce

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

    - Installation request for drupal/commerce ^2.24 -> satisfiable by drupal/commerce[2.24.0].

    - drupal/commerce 2.24.0 requires drupal/inline_entity_form ^1.0-rc6 -> satisfiable by drupal/inline_entity_form[1.x-dev, 1.0.0-rc6, 1.0.0-rc7, 1.0.0-rc8] but these conflict with your requirements or minimum-stability.


解決方式就是先把 inline_entity_form 安裝起來,並指定1.0-rc8版次(安裝時可到頁面檢查最近版本)

composer require drupal/inline_entity_form:1.0-rc8


接著再重新執行一次就能順利把commerce要的模組都裝起

composer require drupal/commerce


Using version ^2.24 for drupal/commerce

./composer.json has been updated

Loading composer repositories with package information

Updating dependencies (including require-dev)

Package operations: 10 installs, 0 updates, 0 removals

  - Installing commerceguys/intl (v1.0.8): Downloading (100%)

  - Installing doctrine/collections (1.6.7): Loading from cache

  - Installing drupal/state_machine (1.0.0): Loading from cache

  - Installing drupal/entity (1.2.0): Loading from cache

  - Installing drupal/profile (1.2.0): Loading from cache

  - Installing drupal/entity_reference_revisions (1.9.0): Downloading (100%)          - Installing drupal/token (1.9.0): Loading from cache

  - Installing commerceguys/addressing (v1.2.0): Downloading (100%)

  - Installing drupal/address (1.9.0): Loading from cache

  - Installing drupal/commerce (2.24.0): Downloading (100%)


裝好後的使用教學
https://docs.drupalcommerce.org/commerce2/user-guide

其他
我在執行安裝過程會回報 Commerce requires the bcmath PHP extension.
記得補裝 apt install php8.0-bcmath

留言

熱門文章