I have an unusual error while running the composer install command.

它需要PHP7.3,而我的是PHP8.0.0.这个问题与100不同,因为我的PHP版本(8.0.0)比要求的要高.为什么它不起作用呢?

Problem 1
    - Root composer.json requires php ^7.3 but your php version (8.0.0) does not satisfy that requirement.         Problem 2
    - asm89/stack-cors is locked to version v2.0.1 and an update of this package was not requested.
    - asm89/stack-cors v2.0.1 requires php ^7.0 -> your php version (8.0.0) does not satisfy that requirement.   Problem 3
    - laravel/framework is locked to version v8.10.0 and an update of this package was not requested.
    - laravel/framework v8.10.0 requires php ^7.3 -> your php version (8.0.0) does not satisfy that requirement.   Problem 4
    - laravel/tinker is locked to version v2.4.2 and an update of this package was not requested.
    - laravel/tinker v2.4.2 requires php ^7.2 -> your php version (8.0.0) does not satisfy that requirement.   Problem 5
    - facade/flare-client-php is locked to version 1.3.6 and an update of this package was not requested.
    - facade/flare-client-php 1.3.6 requires php ^7.1 -> your php version (8.0.0) does not satisfy that requirement.   Problem 6
    - facade/ignition is locked to version 2.4.1 and an update of this package was not requested.
    - facade/ignition 2.4.1 requires php ^7.2.5 -> your php version (8.0.0) does not satisfy that requirement.   Problem 7
    - fzaninotto/faker is locked to version v1.9.1 and an update of this package was not requested.
    - fzaninotto/faker v1.9.1 requires php ^5.3.3 || ^7.0 -> your php version (8.0.0) does not satisfy that requirement.   Problem 8
    - nunomaduro/collision is locked to version v5.0.2 and an update of this package was not requested.
    - nunomaduro/collision v5.0.2 requires php ^7.3 -> your php version (8.0.0) does not satisfy that requirement.   Problem 9
    - asm89/stack-cors v2.0.1 requires php ^7.0 -> your php version (8.0.0) does not satisfy that requirement.
    - fruitcake/laravel-cors v2.0.2 requires asm89/stack-cors ^2.0.1 -> satisfiable by asm89/stack-cors[v2.0.1].
    - fruitcake/laravel-cors is locked to version v2.0.2 and an update of this package was not requested.

推荐答案

It's because in your project in composer.json file you have:

"require": {
    "php": ">=7.3",
    .....
},

Try to update this requirement to:

"require": {
    "php": "^7.3|^8.0",
    .....
},

Laravel相关问答推荐

运行NPM Prod时出现VUE问题

laravel vue 惯性分页器删除上一个和下一个链接

模型文件名更改数据库中的表名

Npm run dev 卡在 APP_URL

(1/1) ErrorException ReflectionFunction::__construct() ex

为什么命令php artisan serve不起作用

如何为路由 laravel 5 使用OR中间件

Eloquent 的集合方法,例如 only 或 except 返回一个空集合

如果用户在 Laravel 中经过身份验证,如何签入 Vue 组件?

合并两个 Eloquent 集合并删除所有重复项.

Laravel 生产问题 - 使用 Laravel 4.1.x 更新composer

Laravel - 自定义时间戳列名称

Laravel 控制器构造

laravel 5.4 指定的key太长,为什么数字191

在Lumen框架中启用会话

使用 Laravel 创建新项目会引发异常

如何在 Laravel 5 中的每个相关输入字段旁边显示验证错误?

遍历 Laravel 控制器中的结果集

Laravel X-CSRF-Token 与 POSTMAN 不匹配

在 Laravel 中判断会话超时