[英]Cant run composer install because a mismatch in PHP version
I have PHP version 8.1.5
as I'm writing this and I'm trying to experiment with older github repo like trix tutorial for example and a problem occurs when I tried to run composer install
an error that said我在写这篇文章时有 PHP 版本8.1.5
,我正在尝试使用旧的 github 存储库,例如trix 教程,当我尝试运行composer install
时出现问题,错误提示
Your lock file does not contain a compatible set of packages. Please run composer update.
Problem 1
- Root composer.json requires php ^7.2.5 but your php version (8.1.5) does not satisfy that requirement.
Problem 2
- doctrine/inflector is locked to version 1.3.1 and an update of this package was not requested.
- doctrine/inflector 1.3.1 requires php ^7.1 -> your php version (8.1.5) does not satisfy that requirement.
Problem 3
- doctrine/lexer is locked to version 1.2.0 and an update of this package was not requested.
- doctrine/lexer 1.2.0 requires php ^7.2 -> your php version (8.1.5) does not satisfy that requirement.
Problem 4
- dragonmantank/cron-expression is locked to version v2.3.0 and an update of this package was not requested.
- dragonmantank/cron-expression v2.3.0 requires php ^7.0 -> your php version (8.1.5) does not satisfy that requirement.
Problem 5
- laravel/framework is locked to version v7.2.1 and an update of this package was not requested.
- laravel/framework v7.2.1 requires php ^7.2.5 -> your php version (8.1.5) does not satisfy that requirement.
...
I certainly don't want to downgrade my PHP version is there a way to upgrade those packages to be compatible with my PHP version?我当然不想降级我的 PHP 版本有没有办法升级这些包以与我的 PHP 版本兼容?
so far I've tried到目前为止我已经尝试过
change my composer.json
file更改我的composer.json
文件
"require": {
"php": ">=8.1.5",
...
},
and和
"require": {
"php": ">=7.2.5",
...
},
and running both composer install
and composer update php --with-all-dependencies
并运行composer install
和composer update php --with-all-dependencies
You can also use Composer's --ignore-platform-reqs
switch to install packages.您还可以使用 Composer 的--ignore-platform-reqs
开关来安装包。 It will install packages without complaining, but it's not guaranteed that your code will run.它会毫无怨言地安装软件包,但不能保证您的代码会运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.