【问题标题】:I got de error when I tried install composer league/flysystem-aws-s3-v3尝试安装 composer League/flysystem-aws-s3-v3 时出现错误
【发布时间】:2021-03-15 22:36:53
【问题描述】:

我在尝试安装 composer League/flysystem-aws-s3-v3 时遇到错误
我的台词:composer 需要 League/flysystem-aws-s3-v3
我使用 Laravel 8 和 php 7.3
我还测试了删除 composer.lock

有人已经修好了?


    Your requirements could not be resolved to an installable set of packages.
    
      Problem 1
        - league/flysystem-aws-s3-v3[2.0.0, ..., 2.x-dev] require league/flysystem ^2.0.0 -> found league/flysystem[2.0.0-alpha.1, ..., 2.x-dev] but the package is fixed to 1.1.3 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
        - league/flysystem-aws-s3-v3[2.0.0-alpha.1, ..., 2.0.0-alpha.2] require league/flysystem 2.0.0-alpha.1 -> found league/flysystem[2.0.0-alpha.1] but the package is fixed to 1.1.3 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
        - league/flysystem-aws-s3-v3[2.0.0-alpha.4, ..., 2.0.0-beta.1] require league/flysystem 2.0.0-alpha.3 -> found league/flysystem[2.0.0-alpha.3] but the package is fixed to 1.1.3 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
        - league/flysystem-aws-s3-v3[2.0.0-beta.2, ..., 2.0.0-beta.3] require league/flysystem ^2.0.0-beta.1 -> found league/flysystem[2.0.0-beta.1, ..., 2.x-dev] but the package is fixed to 1.1.3 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
        - league/flysystem-aws-s3-v3 2.0.0-RC1 requires league/flysystem ^2.0.0-RC1 -> found league/flysystem[2.0.0-RC1, 2.0.0, 2.x-dev] but the package is fixed to 1.1.3 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
        - Root composer.json requires league/flysystem-aws-s3-v3 ^2.0 -> satisfiable by league/flysystem-aws-s3-v3[2.0.0-alpha.1, ..., 2.x-dev].
    
    Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
    
    Installation failed, reverting ./composer.json and ./composer.lock to their original content.

我的 composer.json

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.3",
        "aws/aws-sdk-php": "^3.166",
        "fideloper/proxy": "^4.2",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.0.1",
        "laravel/framework": "^8.17",
        "laravel/tinker": "^2.0",
        "tymon/jwt-auth": "^1.0"
    },
   ...

【问题讨论】:

    标签: laravel amazon-web-services amazon-s3 composer-php


    【解决方案1】:

    我也遇到过同样的问题。我试过了,很有帮助

    composer require league/flysystem-aws-s3-v3 ~1.0
    

    【讨论】:

      【解决方案2】:

      我搜索了一个解决方案,在 1.0 之前使用波浪号将此行放在我的 composer.json 中

      "league/flysystem-aws-s3-v3": "~1.0",

      成功了!!

      【讨论】:

        【解决方案3】:

        你可以试试

        composer require league/flysystem-aws-s3-v3 ^1.0
        

        【讨论】:

          【解决方案4】:

          laravel 文档建议 Laravel 8 使用此命令

          composer require --with-all-dependencies league/flysystem-aws-s3-v3 "^1.0"
          

          它对我有用。早些时候,我尝试使用旧版本的 laravel 文档中的命令进行安装。

          我的 PHP 版本是 7.4

          参考:https://laravel.com/docs/8.x/filesystem#composer-packages

          【讨论】:

            【解决方案5】:

            按照这些步骤,您将能够安装这两个软件包

            • 卸载当前的 guzzle 版本

            composer remove guzzlehttp/guzzle

            • 安装flysystem版本。 - 1.0.0

            composer require league/flysystem-aws-s3-v3:^1.0

            祝你好运:-)

            按照这个顺序,laravel 8 似乎可以同时下载和安装两个 s

            【讨论】:

            • 请在您的答案中添加一些解释,以便其他人可以从中学习。是什么让您认为问题与 Guzzle 有任何关系?
            • 2021 年 10 月 14 日工作
            【解决方案6】:

            php 7.x 和 laravel 8 有两种方式:

            在 Mac 中:

            composer require league/flysystem-aws-s3-v3 ~1.0
            

            在窗口中:

            composer require league/flysystem-aws-s3-v3 ~1.0 --ignore-platform-reqs
            

            编辑:当我们使用 ~1.0 时,这意味着我们需要这个近似版本。在 Windows 中,如果您没有所有要求、插件等,使用 --ignore-platform-reqs 可以跳过问题,这不是最有效的方法,但它可以在生产部署之前暂时提供帮助。如果您不在 Windows 中使用 --ignore-platform-reqs,也许它可以工作,具体取决于您的环境。

            根据this post

            • 使用 ~version: "Approximately equivalent to version",将更新您到所有未来的补丁版本,而不增加次要版本。 ~1.2.3 将使用从 1.2.3 到
            • 使用 ^version: "Compatible with version",将更新您到所有未来的次要/补丁版本,而不增加主要版本。 ^2.3.4 将使用从 2.3.4 到

            【讨论】:

            • 请在您的答案中添加一些解释,以便其他人可以从中学习。
            • 好的,我编辑了它:)
            猜你喜欢
            • 2020-11-29
            • 2021-05-27
            • 2021-04-13
            • 2016-03-10
            • 1970-01-01
            • 2018-12-16
            • 2021-03-08
            • 2015-09-13
            • 2016-05-13
            相关资源
            最近更新 更多