【问题标题】:why I get spatie/laravel-cors[1.2.0, ..., 1.2.2] require illuminate/support 5.5.*|5.6.* when i run composer require spatie/laravel-cors为什么我得到 spatie/laravel-cors[1.2.0, ..., 1.2.2] 需要照明/支持 5.5.*|5.6.* 当我运行 composer require spatie/laravel-cors
【发布时间】:2021-06-05 18:24:24
【问题描述】:

在我将项目从 Laravel 6 升级到 Laravel 7 后面临这个问题。 由于 spatie/laravel-cors 的一些其他错误,我实际上无法将 laravel/framework 包从 6 升级到 7,但是我删除了 spatie/laravel-cors 并升级了 laravel/framework,升级后它不会再次安装。 这是完整的错误:

**Problem 1
    - spatie/laravel-cors[1.2.0, ..., 1.2.2] require illuminate/support 5.5.*|5.6.* -> found illuminate/support[v5.5.0, ..., v5.6.39] but it conflicts with another require.
    - spatie/laravel-cors[1.2.3, ..., 1.3.1] require laravel/framework 5.5.*|5.6.*|5.7.* -> found laravel/framework[v5.5.0, ..., v5.7.29] but it conflicts with your root composer.json require (^7.0).
    - spatie/laravel-cors 1.3.2 requires illuminate/support 5.5.*|5.6.*|5.7.* -> found illuminate/support[v5.5.0, ..., v5.7.28] but it conflicts with another require.
    - spatie/laravel-cors[1.3.3, ..., 1.5.2] require illuminate/support 5.5.*|5.6.*|5.7.*|5.8.* -> found illuminate/support[v5.5.0, ..., v5.8.36] but it conflicts with another require.
    - spatie/laravel-cors 1.6.0 requires illuminate/support 5.5.*|5.6.*|5.7.*|5.8.*|^6.0 -> found illuminate/support[v5.5.0, ..., v5.8.36, v6.0.0, ..., v6.20.17] but it conflicts with another require.
    - Root composer.json requires spatie/laravel-cors ^1.2 -> satisfiable by spatie/laravel-cors[1.2.0, ..., 1.6.0].**

【问题讨论】:

  • 看起来像 spatie/laravel-cors 的最大支持 laravel 版本是 6.0,这是有道理的,因为在 their github page 它说 我们已经放弃了这个包,因为 Laravel 7 引入了对 CORS 的本机支持。仅当您使用 Laravel 6 或更低版本时才使用此包。
  • 你有没有试过检查有问题的包是否与 Laravel 7 兼容?
  • @NicoHaase 谢谢

标签: php laravel composer-php


【解决方案1】:

Spatie/Laravel-cors的github页面上可以找到这条消息:

我们已经放弃了这个包,因为 Laravel 7 引入了对 CORS 的原生支持。仅当您使用 Laravel 6 或更低版本时才使用此包。

为什么你还需要这个包?

【讨论】:

  • 谢谢我没有先注意到。
猜你喜欢
  • 2019-11-09
  • 2019-05-22
  • 2020-09-15
  • 2017-03-11
  • 1970-01-01
  • 1970-01-01
  • 2018-06-06
  • 1970-01-01
  • 2021-09-15
相关资源
最近更新 更多