我有一個使用PHP 7.3和Composer v1的遺留應用程序。有一個已安裝的lcobucci/jwt:3.3.1
庫。這個庫的要求非常簡單:
php: ^5.6 || ^7.0
ext-mbstring: *
ext-openssl: *
現在我想安裝auth0/login
。支持PHP7.3的最后一個版本是6.5.0,并且有更多的deps,但沒有什么特別之處:
php: ^7.3 || ^8.0
ext-filter: *
ext-json: *
ext-mbstring: *
ext-openssl: *
auth0/auth0-php: ^7.9
illuminate/contracts: ^6.0 || ^7.0 || ^8.0
illuminate/support: ^6.0 || ^7.0 || ^8.0
我可以將它們單獨安裝到空項目中。但是,當我嘗試將它們安裝在一起時,會出現一個錯誤:
$ composer require auth0/login:6.5.0 lcobucci/jwt:3.3.1
Problem 1
- Installation request for auth0/login 6.5.0 -> satisfiable by auth0/login[6.5.0].
- lcobucci/jwt 3.3.1 conflicts with auth0/login[6.5.0].
- Installation request for lcobucci/jwt 3.3.1 -> satisfiable by lcobucci/jwt[3.3.1].
對Composer的困惑解釋于事無補。為什么這些庫不能在一個項目中共存?
正如您在packagist.org上的
auth0/login
的conflicts
部分中所看到的,它們的維護者聲明了與lcobucci/jwt
的一般沖突。這意味著,當您想要使用最新版本的v6分支時,您不能將任何版本的JWT包與auth0包一起安裝。此沖突是在v6.4.1中添加的,因此您可以嘗試通過運行
composer require auth0/login 6.4
來安裝v6. 4