web-dev-qa-db-ja.com

Composerクラッシュ

実行するとcomposer updateこのエラーが発生します:

PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Symfony\Component\Console\Question\Question::__construct() must be of the type string, array given, called in /usr/share/php/Composer/IO/ConsoleIO.php on line 239 and defined in /usr/share/php/Symfony/Component/Console/Question/Question.php:37
Stack trace:
#0 /usr/share/php/Composer/IO/ConsoleIO.php(239): Symfony\Component\Console\Question\Question->__construct(Array, 0)
#1 /var/www/html/vendor/zendframework/zend-component-installer/src/ComponentInstaller.php(434): Composer\IO\ConsoleIO->ask(Array, 0)
#2 /var/www/html/vendor/zendframework/zend-component-installer/src/ComponentInstaller.php(195): Zend\ComponentInstaller\ComponentInstaller->promptForConfigOption('Zend\\Navigation', Object(Zend\ComponentInstaller\Collection), 1)
#3 /var/www/html/vendor/zendframework/zend-component-installer/src/Collection.php(92): Zend\ComponentInstaller\ComponentInstaller->Zend\ComponentInstaller\{closure}(Object(Zend\ComponentInstaller\Collection), 'Zend\\N in /usr/share/php/Symfony/Component/Console/Question/Question.php on line 37

Fatal error: Uncaught TypeError: Argument 1 passed to Symfony\Component\Console\Question\Question::__construct() must be of the type string, array given, called in /usr/share/php/Composer/IO/ConsoleIO.php on line 239 and defined in /usr/share/php/Symfony/Component/Console/Question/Question.php:37
Stack trace:
#0 /usr/share/php/Composer/IO/ConsoleIO.php(239): Symfony\Component\Console\Question\Question->__construct(Array, 0)
#1 /var/www/html/vendor/zendframework/zend-component-installer/src/ComponentInstaller.php(434): Composer\IO\ConsoleIO->ask(Array, 0)
#2 /var/www/html/vendor/zendframework/zend-component-installer/src/ComponentInstaller.php(195): Zend\ComponentInstaller\ComponentInstaller->promptForConfigOption('Zend\\Navigation', Object(Zend\ComponentInstaller\Collection), 1)
#3 /var/www/html/vendor/zendframework/zend-component-installer/src/Collection.php(92): Zend\ComponentInstaller\ComponentInstaller->Zend\ComponentInstaller\{closure}(Object(Zend\ComponentInstaller\Collection), 'Zend\\N in /usr/share/php/Symfony/Component/Console/Question/Question.php on line 37

しかし、私のすべてのプロジェクトではありません。

失敗したプロジェクトでは、composer.jsonファイルで次の要件を取得しました。

"require": {
    "php": "^5.6 || ^7.0",
    "ext-Gd": "*",
    "ext-intl": "*",
    "zendframework/zend-component-installer": "^1.0 || ^0.3 || ^1.0.0-dev@dev",
    "zendframework/zend-mvc": "^3.1",
    "zfcampus/zf-development-mode": "^3.0",
    "zendframework/zend-mvc-form": "^1.0",
    "zendframework/zend-mvc-plugins": "^1.0.1",
    "zendframework/zend-session": "^2.7.1",
    "zendframework/zend-authentication": "^2.5",
    "doctrine/doctrine-orm-module": "^1.1.5",
    "doctrine/migrations": "^1.5",
    "zendframework/zend-math": "^3.0",
    "zendframework/zend-crypt": "^3.1",
    "zendframework/zend-captcha": "^2.6",
    "zendframework/zend-mail": "^2.10",
    "zendframework/zend-mime": "^2.7",
    "symfony/polyfill-iconv": "^1.13"
},

ウェブサイトを更新/インストールするにはどうすればよいですか?

PHP 7.3.12-1
作曲家1.9.12019-11-01 17:20:17

1
Boba Fit

ヒントをありがとうceejayoz。

古いバージョンのzendframework/zend-component-installerを使用しました

"zendframework/zend-component-installer": "^2.1.2",に変更してから、コンポーザーcomposer update zendframework/zend-component-installerを更新し、最後にすべてを更新できました:composer update

0
Boba Fit