PHP
Composer
laravel

composer require laravel/passport が失敗する

Laravel5.5で、

$ php artisan -V

--------

Laravel Framework 5.5.20

laravel/passportの最新版をインストールしようとすると失敗します。

$ composer require laravel/passport

--------

Using version ^5.0 for laravel/passport
./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 laravel/passport ^5.0 -> satisfiable by laravel/passport[v5.0.0].
    - Conclusion: remove laravel/framework v5.5.20
    - Conclusion: don't install laravel/framework v5.5.20
    - laravel/passport v5.0.0 requires illuminate/encryption ~5.6 -> satisfiable by illuminate/encryption[v5.6.0, v5.6.1, v5.6.2, v5.6.3].
    - don't install illuminate/encryption v5.6.0|don't install laravel/framework v5.5.20
    - don't install illuminate/encryption v5.6.1|don't install laravel/framework v5.5.20
    - don't install illuminate/encryption v5.6.2|don't install laravel/framework v5.5.20
    - don't install illuminate/encryption v5.6.3|don't install laravel/framework v5.5.20
    - Installation request for laravel/framework (locked at v5.5.20, required as 5.5.*) -> satisfiable by laravel/framework[v5.5.20].


Installation failed, reverting ./composer.json to its original content.

バージョンを下げましょう。

$ composer require laravel/passport "4.0.3"

--------

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 13 installs, 0 updates, 0 removals
  - Installing psr/http-message (1.0.1): Loading from cache
  - Installing zendframework/zend-diactoros (1.7.0): Downloading (100%)         
  - Installing symfony/psr-http-message-bridge (v1.0.2): Downloading (100%)         
  - Installing phpseclib/phpseclib (2.0.9): Downloading (100%)         
  - Installing defuse/php-encryption (v2.1.0): Downloading (100%)         
  - Installing lcobucci/jwt (3.2.2): Downloading (100%)         
  - Installing league/event (2.1.2): Downloading (100%)         
  - Installing league/oauth2-server (6.1.1): Downloading (100%)         
  - Installing guzzlehttp/promises (v1.3.1): Loading from cache
  - Installing guzzlehttp/psr7 (1.4.2): Loading from cache
  - Installing guzzlehttp/guzzle (6.3.0): Loading from cache
  - Installing firebase/php-jwt (v5.0.0): Downloading (100%)         
  - Installing laravel/passport (v4.0.3): Downloading (100%)         
phpseclib/phpseclib suggests installing ext-libsodium (SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.)
phpseclib/phpseclib suggests installing ext-gmp (Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.)
lcobucci/jwt suggests installing mdanter/ecc (Required to use Elliptic Curves based algorithms.)
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
Discovered Package: fideloper/proxy
Discovered Package: laravel/tinker
Discovered Package: laravelcollective/html
Discovered Package: jeroennoten/laravel-adminlte
Discovered Package: barryvdh/laravel-snappy
Discovered Package: prettus/l5-repository
Discovered Package: laravel/passport
Package manifest generated successfully.

【参考】
https://github.com/laravel/passport/issues/631