Adobe Commerce 2.4.4 へのアップグレード時の Composer プラグインの問題
この文書では、Adobe Commerce 2.4.3 以前からAdobe Commerce 2.4.4 以降(将来のバージョンがリリースされた場合)にアップグレードする際の、Composer プラグインの問題を回避する方法について説明します。
説明 description
環境
- Adobe Commerce オンプレミス、2.4.4 以降(リリース時)にアップデートする際の任意のバージョン
- クラウドインフラストラクチャー上のAdobe Commerce、2.4.4 以降(リリース時)にアップデートする際の任意のバージョン
- Magento Open Source(2.4.4 以降にアップデートする際の任意のバージョン)(リリース時)
問題/症状
2022 年 7 月以降にAdobe Commerce 2.4.4 以降にアップデートすると、プラグインに関して composer から警告が表示される場合があります。
再現手順
前提条件: Adobe Commerce 2.4.3 以前がインストールされている。
- アップグレードの実行 の説明に従って、アップグレードを開始します。
- composer update コマンドを実行して、Adobe Commerce アプリケーションをアップグレードします。
期待される結果
アップグレードが正常に終了しました。
実際の結果
インストールが失敗し、次のようなエラーが表示されます。
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 591 installs, 0 updates, 0 removals
- Installing laminas/laminas-dependency-plugin (2.2.0): Extracting archive
laminas/laminas-dependency-plugin contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins
Do you trust "laminas/laminas-dependency-plugin" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [ y,n,d,?] y
Plugin initialization failed (require(app/etc/NonComposerComponentRegistration.php): failed to open stream: No such file or directory), uninstalling plugin
- Removing laminas/laminas-dependency-plugin (2.2.0)
Install of laminas/laminas-dependency-plugin failed
[ ErrorException]
require(app/etc/NonComposerComponentRegistration.php): failed to open stream: No such file or directory
原因
2022 年 7 月以降、Composer は allow-plugins オプションのデフォルト値を に変更し {} 許可されない限りプラグインは読み込まれません。
解決策 resolution
-
Adobe Commerceのインストール方法に応じて、
composer.jsonファイルに次を追加します。-
プロジェクトが作成されている場合
composer create-projectコマンドを使用 :code language-none "config": { "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true, "laminas/laminas-dependency-plugin": true, "magento/*": true } }- プロジェクトが別の方法で作成され、
dealerdirect/phpcodesniffer-installer" in "require-devのセクションがない場合:
code language-none "config": { "allow-plugins": { "laminas/laminas-dependency-plugin": true, "magento/*": true } } - プロジェクトが別の方法で作成され、
-
-
composer.jsonファイルを更新した後、composer updateコマンドを実行し、アップグレードプロセスを再開します。
recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f