laravel 安装软件包时出错(安装失败,正在恢复,/composer.json的原始内容,)

mnemlml8  于 2023-05-01  发布在  其他
关注(0)|答案(6)|浏览(148)

我想安装一个软件包“composer require rpsimao/invoicexpress-api”,但出现错误:

Using version ^0.5.6 for rpsimao/invoicexpress-api
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for rpsimao/invoicexpress-api ^0.5.6 -> satisfiable by rpsimao/invoicexpress-api[0.5.6].
    - rpsimao/invoicexpress-api 0.5.6 requires laravel/framework 5.4.* -> satisfiable by laravel/framework[5.4.x-dev, v5.4.0, v5.4.1, v5.4.10, v5.4.11, v5.4.12, v5.4.13, v5.4.14, v5.4.15, v5.4.16, v5.4.17, v5.4.18, v5.4.19, v5.4.2, v5.4.20, v5.4.21, v5.4.22, v5.4.23, v5.4.24, v5.4.25, v5.4.26, v5.4.27, v5.4.28, v5.4.29, v5.4.3, v5.4.30, v5.4.31, v5.4.32, v5.4.33, v5.4.34, v5.4.35, v5.4.36, v5.4.4, v5.4.5, v5.4.6, v5.4.7, v5.4.8, v5.4.9] but these conflict with your requirements or minimum-stability.

Installation failed, reverting ./composer.json to its original content.

你知道怎么解决吗?我用的是laravel 5。5,似乎该软件包支持该版本,但它出现的错误.

5t7ly7z5

5t7ly7z51#

尽管他们说用Laravel 5进行测试5.***it in the readme,composer.json说这两个都需要

"laravel/framework": "5.4.*",
"illuminate/support": "5.4.*",

如果包裹是 composer json说应该是Laravel 5。4.*.您正在使用laravel 5。5、不兼容。
下面是标签0的rpsimao/invoicexpress-api composer.json文件。5.6.参见Laravel版本

{
    "name": "rpsimao/invoicexpress-api",
    "description": "Laravel Package to interact with InvoiceXpress API",
    "type": "library",
    "keywords": [
        "laravel",
        "rpsimao",
        "invoicexpress-api",
        "invoicexpress",
        "api"
    ],
    "homepage": "https://github.com/rpsimao/invoicexpress-api",
    "license": "MIT",
    "authors": [
        {
            "name": "Ricardo Simão",
            "email": "ricardo.simao@upgrade.pt"
        }
    ],
    "require": {
        "php": "^7.0",
        "guzzlehttp/guzzle": "^6.2.1",
        "guzzlehttp/psr7": "^1.4.1",
        "guzzlehttp/promises": "~1.0",
        "laravel/framework": "5.4.*",
        "illuminate/support": "5.4.*",
        "spatie/array-to-xml": "^2.5"
    },
    "autoload": {
        "psr-4": {
            "rpsimao\\InvoiceXpressAPI\\": "src/"
        },
        "files":[
            "src/Helpers/invoicexpress-api.php"
        ]
    },
    "require-dev": {
        "phpunit/phpunit": "^6.1",
        "orchestra/testbench": "^3.4"
    },
    "autoload-dev": {
        "psr-4": {
            "rpsimao\\InvoiceXpressAPI\\Test\\": "tests/"
        }
    },
    "extra": {
    "laravel": {
        "providers": [
            "rpsimao\\InvoiceXpressAPI\\InvoiceXpressAPIServiceProvider"
        ],
        "aliases": {
            "InvoiceXpressClients": "rpsimao\\InvoiceXpressAPI\\InvoiceXpressAPIFacade"
           }
        }
    }
}

编辑后

所以,目前还不能使用Laravel 5。Laravel 5.5使用PHP〉=7。0.0,这个包使用Laravel 5。4使用PHP〉=5。6.4.
然后删除 composer 。锁定文件(如果存在)

7gyucuyw

7gyucuyw2#

该软件包还没有更新以与laravel 5一起工作。5.可以验证它对packagist的依赖:
https://packagist.org/packages/rpsimao/invoicexpress-api#0.5.6
Invoicexpress需要laravel/framework:5.4.*
另外,dev-master版本不适合laravel 5。5
dev-master 2018-01-10 15:20 UTC requires
guzzlehttp/guzzle:
^6.2.1 guzzlehttp/psr7:^1.4.1
guzzlehttp/promises:~1.0
laravel/framework:5.4.*
照明/支撑:5.4.*
php:^7.0
spatie/array-to-xml:^2.5

7uhlpewt

7uhlpewt3#

它在ubuntu上工作,必须检查laravel设置环境

$ composer create-project laravel/laravel BlogLaravel "7.*"

为 composer 和laravel设置环境路径

$ export PATH="$PATH:$HOME/.composer/vendor/bin"
$ echo 'export PATH="$PATH:$HOME/.composer/vendor/bin"' >> ~/.bashrc
$ source ~/.bashrc
lzfw57am

lzfw57am4#

如果你尝试安装“jwt-auth”并得到错误,请尝试使用此代码

composer require tymon/jwt-auth:dev-develop --prefer-source

php artisan vendor:publish 

php artisan jwt:secret
juzqafwq

juzqafwq5#

我试图通过Composer包管理器安装passport,我通过在命令末尾使用-W来解决这个错误,如下所示:

composer require laravel/passport -W
-W表示包含所有依赖项,因此您也可以安装所需的软件包而不会出现任何错误。

lo8azlld

lo8azlld6#

1. remove ./composer/cache folder
2. run composer global update

**对于Laravel Developer:**不同的laravel版本支持不同的Vuejs版本。首先,找出哪个laravel版本支持vuejs版本。比安装它。

示例:
Laravel 7支持vuejs 2.4.
所以安装了它
composer require laravel/ui:^2.4

相关问题