我正在使用Windows操作系统运行PHPLaravel-8应用程序.我的中所有项目的PHP版本都是PHP-Version3.8。在我的本地系统中,所有Laravel项目都有("php":“^7.3 x^8.0”,)
然而,我做了一个团队项目的拉请求,但它是4。该项目还使用了Laravel-8框架("php":“^7.4 x^8.0”,)
当我试图在下载的项目上运行composer安装时,我得到了以下错误:
Your lock file does not contain a compatible set of packages. Please run composer update.
Problem 1
- Root composer.json requires php ^7.4|^8.0 but your PHP version (7.3.8) does not satisfy that requirement.
Problem 2
- lcobucci/clock is locked to version 2.0.0 and an update of this package was not requested.
- lcobucci/clock 2.0.0 requires php ^7.4 || ^8.0 -> your php version (7.3.8) does not satisfy that requirement.
Problem 3
- lcobucci/jwt is locked to version 4.0.3 and an update of this package was not requested.
- lcobucci/jwt 4.0.3 requires php ^7.4 || ^8.0 -> your php version (7.3.8) does not satisfy that requirement.
Problem 4
- lcobucci/jwt 4.0.3 requires php ^7.4 || ^8.0 -> your php version (7.3.8) does not satisfy that requirement.
- league/oauth2-server 8.2.4 requires lcobucci/jwt ^3.4 || ^4.0 -> satisfiable by lcobucci/jwt[4.0.3].
- league/oauth2-server is locked to version 8.2.4 and an update of this package was not requested.然后,当我更新composer时,错误就是:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires php ^7.4|^8.0 but your php version (7.3.8) does not satisfy that requirement.所有的项目都使用composer-2。
如果我将我的本地系统升级到PHPV-7.4,我将对已部署的项目产生问题。
我怎么才能解决这个问题?
谢谢
发布于 2021-05-01 08:57:09
打开composer.json文件并将版本替换为:
"require": {
"php": "^7.3|^8.0",
},您还可以使用以下命令:
composer install --ignore-platform-reqs编辑:
如果这样做不起作用或导致更多问题,我建议您更新PHP版本,然后您必须为旧项目指定PHP版本,并将它们绑定到使用PHP 7.3以避免任何问题。在更新composer.json之后,在每个旧项目的文件中添加以下行:
"config": {
"platform": {
"php": "7.3"
}
},https://stackoverflow.com/questions/67344437
复制相似问题