Warning: count(): Parameter must be an array or an object that implements Countable in C:\var\www\home\apitest\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 67
|
1 2 |
$cnt=!empty($this->handles)?count($this->handles):0; if ($cnt >= $this->maxHandles) { |

【Laravel8】”composer require google/apiclient”実行時にエラーになる場合の対処方法
Google Cloud API(今回はCloud Vision API)をLaravelで使いたいと思って、"composer require google/apiclient"を実行したら以下のエラーになった。※&q...
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
C:\var\www\home\laravel_sample>php "C:\ProgramData\ComposerSetup\bin\composer.phar" remove guzzlehttp/guzzle @@@./composer.json has been updated Running composer update guzzlehttp/guzzle Loading composer repositories with package information Updating dependencies Lock file operations: 0 installs, 0 updates, 7 removals - Removing guzzlehttp/guzzle (7.4.1) - Removing guzzlehttp/promises (1.5.1) - Removing guzzlehttp/psr7 (2.1.0) - Removing psr/http-client (1.0.1) - Removing psr/http-factory (1.0.1) - Removing psr/http-message (1.0.1) - Removing ralouphie/getallheaders (3.0.3) Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 0 installs, 0 updates, 7 removals - Removing ralouphie/getallheaders (3.0.3) - Removing psr/http-message (1.0.1) - Removing psr/http-factory (1.0.1) - Removing psr/http-client (1.0.1) - Removing guzzlehttp/psr7 (2.1.0) - Removing guzzlehttp/promises (1.5.1) - Removing guzzlehttp/guzzle (7.4.1) Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead. Generating optimized autoload files Class App\Http\Controllers\Hello3Controller located in C:/var/www/home/laravel_sample/app\Http\Controllers\HelloController3.php does not comply with psr-4 autoloading standard. Skipping. > Illuminate\Foundation\ComposerScripts::postAutoloadDump > @php artisan package:discover --ansi Discovered Package: facade/ignition Discovered Package: fruitcake/laravel-cors Discovered Package: laravel/sail Discovered Package: laravel/sanctum Discovered Package: laravel/tinker Discovered Package: nesbot/carbon Discovered Package: nunomaduro/collision Package manifest generated successfully. 74 packages you are using are looking for funding. Use the `composer fund` command to find out more! > @php artisan vendor:publish --tag=laravel-assets --ansi --force No publishable resources for tag [laravel-assets]. Publishing complete. C:\var\www\home\laravel_sample> |
既にインストールしてある場所だとエラーになった
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
C:\var\www\home\laravel_sample>composer require google/apiclient:^2.0 C:\var\www\home\laravel_sample>setlocal DISABLEDELAYEDEXPANSION C:\var\www\home\laravel_sample>php "C:\ProgramData\ComposerSetup\bin\composer.phar" require google/apiclient:2.0 @@@./composer.json has been updated Running composer update google/apiclient Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages. Problem 1 - Root composer.json requires google/apiclient 2.0 -> satisfiable by google/apiclient[v2.0.0]. - google/apiclient v2.0.0 requires monolog/monolog ^1.17 -> found monolog/monolog[1.17.0, ..., 1.x-dev] but the package is fixed to 2.3.5 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command. Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions. Installation failed, reverting ./composer.json and ./composer.lock to their original content. C:\var\www\home\laravel_sample> |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
C:\var\www\home\apitest>composer require google/apiclient:^2.0 C:\var\www\home\apitest>setlocal DISABLEDELAYEDEXPANSION C:\var\www\home\apitest>php "C:\ProgramData\ComposerSetup\bin\composer.phar" require google/apiclient:2.0 @@@./composer.json has been created Running composer update google/apiclient Loading composer repositories with package information Updating dependencies Lock file operations: 12 installs, 0 updates, 0 removals - Locking firebase/php-jwt (v3.0.0) - Locking google/apiclient (v2.0.0) - Locking google/apiclient-services (v0.233.0) - Locking google/auth (v0.8) - Locking guzzlehttp/guzzle (6.2.0) - Locking guzzlehttp/promises (1.5.1) - Locking guzzlehttp/psr7 (1.2.3) - Locking monolog/monolog (1.26.1) - Locking phpseclib/phpseclib (2.0.36) - Locking psr/cache (1.0.1) - Locking psr/http-message (1.0.1) - Locking psr/log (1.1.4) Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 12 installs, 0 updates, 0 removals - Downloading phpseclib/phpseclib (2.0.36) - Downloading monolog/monolog (1.26.1) - Downloading guzzlehttp/psr7 (1.2.3) - Downloading guzzlehttp/guzzle (6.2.0) - Downloading psr/cache (1.0.1) - Downloading firebase/php-jwt (v3.0.0) - Downloading google/auth (v0.8) - Downloading google/apiclient-services (v0.233.0) - Downloading google/apiclient (v2.0.0) - Installing phpseclib/phpseclib (2.0.36): Extracting archive - Installing psr/log (1.1.4): Extracting archive - Installing monolog/monolog (1.26.1): Extracting archive - Installing psr/http-message (1.0.1): Extracting archive - Installing guzzlehttp/psr7 (1.2.3): Extracting archive - Installing guzzlehttp/promises (1.5.1): Extracting archive - Installing guzzlehttp/guzzle (6.2.0): Extracting archive - Installing psr/cache (1.0.1): Extracting archive - Installing firebase/php-jwt (v3.0.0): Extracting archive - Installing google/auth (v0.8): Extracting archive - Installing google/apiclient-services (v0.233.0): Extracting archive - Installing google/apiclient (v2.0.0): Extracting archive 15 package suggestions were added by new dependencies, use `composer suggest` to see details. Generating autoload files 3 packages you are using are looking for funding. Use the `composer fund` command to find out more! C:\var\www\home\apitest> |
