Composer在安装新软件包时保留与更新无关的软件包

时间:2019-06-10 03:46:51

标签: php laravel composer-php

我正在尝试通过运行composer install mycompany/qlog从我公司的软件包回购中安装新的私人托管软件包。但是这个命令给我这样的未满足的依赖错误:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package elasticquent/elasticquent (locked at 1.0.x-dev, required as ^1.0) is satisfiable by elasticquent/elasticquent[1.0.x-dev] but these conflict with your requirements or minimum-stability.
  Problem 2
    - Conclusion: don't install elasticquent/elasticquent v1.0.6
    - ...
    - Conclusion: don't install elasticquent/elasticquent v1.0.1
    - Conclusion: remove laravel/framework v5.1.31
    - Installation request for elasticsearch/elasticsearch (locked at v2.1.5) -> satisfiable by elasticsearch/elasticsearch[v2.1.5].
    - Conclusion: don't install laravel/framework v5.1.31
    - elasticquent/elasticquent v1.0.0 requires illuminate/database ~4.2 -> satisfiable by illuminate/database[v4.2.1, v4.2.12, v4.2.16, v4.2.17, v4.2.2, v4.2.3, v4.2.4, v4.2.5, v4.2.6, v4.2.7, v4.2.8, v4.2.9].
    - elasticquent/elasticquent v1.0.5 requires illuminate/config ~4.2|~5.2 -> satisfiable by illuminate/config[5.7.17, 5.7.18, 5.7.19, v4.2.1, v4.2.12, v4.2.16, v4.2.17, v4.2.2, v4.2.3, v4.2.4, v4.2.5, v4.2.6, v4.2.7, v4.2.8, v4.2.9, v5.2.0, v5.2.19, ..., v5.8.9].
    - don't install illuminate/database v4.2.1|don't install laravel/framework v5.1.31
    - don't install illuminate/database v4.2.12|don't install laravel/framework v5.1.31
    - don't install illuminate/database v4.2.16|don't install laravel/framework v5.1.31
    - ...
    - don't install illuminate/config v5.8.9|don't install laravel/framework v5.1.31
    - Installation request for laravel/framework (locked at v5.1.31, required as 5.1.*) -> satisfiable by laravel/framework[v5.1.31].
    - Installation request for elasticquent/elasticquent ^1.0 -> satisfiable by elasticquent/elasticquent[v1.0.0, v1.0.1, v1.0.2, v1.0.3, v1.0.4, v1.0.5, v1.0.6].


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

这是composer.json文件:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.1.*",
        "barryvdh/laravel-debugbar": "^2.2",
        "phpoffice/phpexcel": "^1.8",
        "illuminate/html": "~5.0",
        "guzzlehttp/guzzle": "^6.1",
        "elibyy/laravel-tcpdf": "0.*",
        "jenssegers/agent": "^2.3",
        "overtrue/laravel-lang": "~1.0",
        "predis/predis": "^1.0",
        "jenssegers/mongodb": "^3.2",
        "symfony/workflow": "^3.3",
        "elasticquent/elasticquent": "^1.0",
        "simplesoftwareio/simple-qrcode": "1.3.*"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~4.0",
        "phpspec/phpspec": "~2.1"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {},
    "config": {
        "preferred-install": "dist",
        "secure-http": false
    },
    "repositories": [
        {
            "type": "composer",
            "url": "http://packages.mycompany.com"
        }
    ]
}

我也打算发布composer.lock,但这将超出stackoverflow的长度限制。因此,如果需要,我会将其发布到代码箱中。

该错误提示:

The requested package elasticquent/elasticquent (locked at 1.0.x-dev, required as ^1.0) is satisfiable by elasticquent/elasticquent[1.0.x-dev] but these conflict with your requirements or minimum-stability

此软件包不是我安装的,因此我对这种情况感到困惑。

我的第一个问题

这是怎么发生的:composer.json被指定为^1.0版本,为什么可以将其锁定在1.0.x-dev?在作曲家文档中,1.0.x-dev的意思是checkout the branch v1.0,对吗?但是指定的版本^1.0意味着获得标签v1.0正确吗?为什么锁定版本是忽略指定标签版本的分支?

我的第二个问题

mycompany/qlog与软件包elasticquent/elastiquent无关,所以我不知道为什么作曲家会检查弹性并更新它

我尝试通过将elasticquent软件包的版本constrait修改为1.0.x-dev作为错误信息提示来解决依赖项冲突。现在已经安装了qlog软件包,但是更新了许多其他无关的软件包,因此破坏了应用程序。这是版本约束修改后的composer require mycompany/qlog

Resolving dependencies through SAT
Dependency resolution completed in 2.091 seconds
    Finished: success: 0, skipped: 0, failure: 1, total: 1
Analyzed 20734 packages to resolve dependencies
Analyzed 794828 rules to resolve dependencies
Resolving dependencies through SAT
Dependency resolution completed in 0.001 seconds
Package operations: 9 installs, 3 updates, 1 removal
Installs: symfony/polyfill-ctype:v1.11.0, mycompany/qlog:v1.4.0, react/promise:v2.5.1, guzzlehttp/streams:3.0.0, guzzlehttp/ringphp:1.1.0, elasticsearch/elasticsearch:v2.1.5, elasticquent/elasticquent:dev-master 46c838b, bacon/bacon-qr-code:1.0.3, simplesoftwareio/simple-qrcode:1.3.3
Updates: symfony/inflector:v4.3.1, symfony/property-access:v4.3.1, symfony/workflow:v3.4.28
Removals: symfony/polyfill-php70
  - Removing symfony/polyfill-php70 (v1.5.0)
  - Installing symfony/polyfill-ctype (v1.11.0): Reading /Users/me/.composer/cache/files/symfony/polyfill-ctype/8f6123e97ba0dd7fba0bdea188a7c0cd189e1b23.zip from cache
Loading from cache
 Extracting archiveExecuting command (CWD): unzip -qq  '/Users/me/Env/mine/www/myprojectdir/vendor/symfony/polyfill-ctype/d7700655deb817bdbda8cadf84f6b7ca' -d '/Users/me/Env/mine/www/myprojectdir/vendor/composer/250e6882'
    REASON: symfony/inflector v4.3.1 requires symfony/polyfill-ctype ~1.8 -> satisfiable by symfony/polyfill-ctype[v1.10.0, v1.11.0, v1.8.0, v1.9.0].

  - Updating symfony/inflector (v3.3.10 => v4.3.1): Reading /Users/me/.composer/cache/files/symfony/inflector/19b81019d6f3f7bbe89b2e41829ea30ac367d442.zip from cache
Loading from cache Extracting archiveExecuting command (CWD): unzip -qq  '/Users/me/Env/mine/www/myprojectdir/vendor/symfony/inflector/935303bfedc29c615080c99cca4a567c' -d '/Users/me/Env/mine/www/myprojectdir/vendor/composer/794ff823'

    REASON: symfony/property-access v4.3.1 requires symfony/inflector ~3.4|~4.0 -> satisfiable by symfony/inflector[v3.4.0, ..., v4.3.1].

  - Updating symfony/property-access (v3.3.10 => v4.3.1): Reading /Users/me/.composer/cache/files/symfony/property-access/bb81e51bb4a9b13199e1e2ec668734bb23e88eb7.zip from cache
Loading from cache Extracting archiveExecuting command (CWD): unzip -qq  '/Users/me/Env/mine/www/myprojectdir/vendor/symfony/property-access/d8a03959d982b6ff33f682c0f586f841' -d '/Users/me/Env/mine/www/myprojectdir/vendor/composer/89a5a050'

    REASON: symfony/workflow v3.4.28 requires symfony/property-access ~2.3|~3.0|~4.0 -> satisfiable by symfony/property-access[v3.3.10, ..., v4.3.1].

  - Updating symfony/workflow (v3.3.10 => v3.4.28): Reading /Users/me/.composer/cache/files/symfony/workflow/626864a66cc1f46d652bffc6638647c422b38f48.zip from cache
Loading from cache Extracting archiveExecuting command (CWD): unzip -qq  '/Users/me/Env/mine/www/myprojectdir/vendor/symfony/workflow/e7d1cbf0438cf58b89cc3ea761c4f93a' -d '/Users/me/Env/mine/www/myprojectdir/vendor/composer/c23c2c52'

    REASON: Required by the root package: Install command rule (install symfony/workflow v3.3.10|install symfony/workflow v3.3.0|install symfony/workflow v3.3.1|install symfony/workflow v3.3.10|install symfony/workflow v3.3.11|install symfony/workflow v3.3.12|install symfony/workflow v3.3.13|install symfony/workflow v3.3.14|install symfony/workflow v3.3.15|install symfony/workflow v3.3.16|install symfony/workflow v3.3.17|install symfony/workflow v3.3.18|install symfony/workflow v3.3.2|install symfony/workflow v3.3.3|install symfony/workflow v3.3.4|install symfony/workflow v3.3.5|install symfony/workflow v3.3.6|install symfony/workflow v3.3.7|install symfony/workflow v3.3.8|install symfony/workflow v3.3.9|install symfony/workflow v3.4.0|install symfony/workflow v3.4.1|install symfony/workflow v3.4.10|install symfony/workflow v3.4.11|install symfony/workflow v3.4.12|install symfony/workflow v3.4.13|install symfony/workflow v3.4.14|install symfony/workflow v3.4.15|install symfony/workflow v3.4.16|install symfony/workflow v3.4.17|install symfony/workflow v3.4.18|install symfony/workflow v3.4.19|install symfony/workflow v3.4.2|install symfony/workflow v3.4.20|install symfony/workflow v3.4.21|install symfony/workflow v3.4.22|install symfony/workflow v3.4.23|install symfony/workflow v3.4.24|install symfony/workflow v3.4.25|install symfony/workflow v3.4.26|install symfony/workflow v3.4.27|install symfony/workflow v3.4.28|install symfony/workflow v3.4.3|install symfony/workflow v3.4.4|install symfony/workflow v3.4.5|install symfony/workflow v3.4.6|install symfony/workflow v3.4.7|install symfony/workflow v3.4.8|install symfony/workflow v3.4.9)

  - Installing mycompany/qlog (v1.4.0): Reading /Users/me/.composer/cache/files/mycompany/qlog/0de61ce3ddcc4bffe6c92f387f90e92c911f2753.zip from cache
Loading from cache
 Extracting archiveExecuting command (CWD): unzip -qq  '/Users/me/Env/mine/www/myprojectdir/vendor/mycompany/qlog/44f60c724c3f3981222e16787f349478.zip' -d '/Users/me/Env/mine/www/myprojectdir/vendor/composer/c1ba2c86'
    REASON: Required by the root package: Install command rule (install mycompany/qlog v1.4.0)

  - Installing react/promise (v2.5.1): Reading /Users/me/.composer/cache/files/react/promise/599abae8212f9ffdb0920dcf6fcd39c27ad7efb1.zip from cache
Loading from cache
 Extracting archiveExecuting command (CWD): unzip -qq  '/Users/me/Env/mine/www/myprojectdir/vendor/react/promise/22f7d76cd7234deeb6135cc96c2999ce' -d '/Users/me/Env/mine/www/myprojectdir/vendor/composer/da7510a8'
    REASON: Required by the root package: Install command rule (install react/promise v2.5.1|install react/promise v2.5.1)

  - Installing guzzlehttp/streams (3.0.0): Reading /Users/me/.composer/cache/files/guzzlehttp/streams/4baac21a7e26e5b253983aef7f4b13f1e628529f.zip from cache
Loading from cache
 Extracting archiveExecuting command (CWD): unzip -qq  '/Users/me/Env/mine/www/myprojectdir/vendor/guzzlehttp/streams/7a44f696de796083152d5f71f49a94a0' -d '/Users/me/Env/mine/www/myprojectdir/vendor/composer/278af5f1'
    REASON: Required by the root package: Install command rule (install guzzlehttp/streams 3.0.0|install guzzlehttp/streams 3.0.0)

  - Installing guzzlehttp/ringphp (1.1.0): Reading /Users/me/.composer/cache/files/guzzlehttp/ringphp/519e7b672ec51507b1e9648ac05d99e31a977dfb.zip from cache
Loading from cache
 Extracting archiveExecuting command (CWD): unzip -qq  '/Users/me/Env/mine/www/myprojectdir/vendor/guzzlehttp/ringphp/5c249be1603826ecc6bb5c9c353b3e33' -d '/Users/me/Env/mine/www/myprojectdir/vendor/composer/feba6c6e'
    REASON: Required by the root package: Install command rule (install guzzlehttp/ringphp 1.1.0|install guzzlehttp/ringphp 1.1.0)

  - Installing elasticsearch/elasticsearch (v2.1.5): Reading /Users/me/.composer/cache/files/elasticsearch/elasticsearch/b66b00e149b383b608ad652896fc1d2d580b2165.zip from cache
Loading from cache
 Extracting archiveExecuting command (CWD): unzip -qq  '/Users/me/Env/mine/www/myprojectdir/vendor/elasticsearch/elasticsearch/3d87e8cc083e4803c435095eca5c11c0' -d '/Users/me/Env/mine/www/myprojectdir/vendor/composer/4c42bf6c'
    REASON: Required by the root package: Install command rule (install elasticsearch/elasticsearch v2.1.5|install elasticsearch/elasticsearch v2.1.5)

  - Installing elasticquent/elasticquent (dev-master 46c838b): Executing command (CWD): git --version

    Cloning to cache at '/Users/me/.composer/cache/vcs/https---github.com-elasticquent-Elasticquent.git/'
Executing command (/Users/me/.composer/cache/vcs/https---github.com-elasticquent-Elasticquent.git/): git rev-parse --git-dir
Executing command (/Users/me/.composer/cache/vcs/https---github.com-elasticquent-Elasticquent.git/): git rev-parse --quiet --verify '46c838bc1de1f0a2e3e4d28254700171aa51df03^{commit}'
Cloning 46c838bc1de1f0a2e3e4d28254700171aa51df03 from cache
Executing command (CWD): git clone --no-checkout '/Users/me/.composer/cache/vcs/https---github.com-elasticquent-Elasticquent.git/' '/Users/me/Env/mine/www/myprojectdir/vendor/elasticquent/elasticquent' --dissociate --reference '/Users/me/.composer/cache/vcs/https---github.com-elasticquent-Elasticquent.git/' && cd '/Users/me/Env/mine/www/myprojectdir/vendor/elasticquent/elasticquent' && git remote set-url origin 'https://github.com/elasticquent/Elasticquent.git' && git remote add composer 'https://github.com/elasticquent/Elasticquent.git'
Executing command (/Users/me/Env/mine/www/myprojectdir/vendor/elasticquent/elasticquent): git remote set-url --push origin 'git@github.com:elasticquent/Elasticquent.git'
Executing command (/Users/me/Env/mine/www/myprojectdir/vendor/elasticquent/elasticquent): git branch -r
Executing command (/Users/me/Env/mine/www/myprojectdir/vendor/elasticquent/elasticquent): git checkout 'master' --
Executing command (/Users/me/Env/mine/www/myprojectdir/vendor/elasticquent/elasticquent): git reset --hard '46c838bc1de1f0a2e3e4d28254700171aa51df03' --
  - Marking elasticquent/elasticquent (1.0.x-dev 46c838b) as installed, alias of elasticquent/elasticquent (dev-master 46c838b)
  - Installing bacon/bacon-qr-code (1.0.3): Reading /Users/me/.composer/cache/files/bacon/bacon-qr-code/9f271803abf7ddd3ec3899c279cecddce9b95742.zip from cache
Loading from cache
 Extracting archiveExecuting command (CWD): unzip -qq  '/Users/me/Env/mine/www/myprojectdir/vendor/bacon/bacon-qr-code/dbb825673a6152cd6a88c0296bea69e2' -d '/Users/me/Env/mine/www/myprojectdir/vendor/composer/1586a358'
    REASON: simplesoftwareio/simple-qrcode 1.3.3 requires bacon/bacon-qr-code 1.0.* -> satisfiable by bacon/bacon-qr-code[1.0.0, 1.0.1, 1.0.2, 1.0.3].

  - Installing simplesoftwareio/simple-qrcode (1.3.3): Reading /Users/me/.composer/cache/files/simplesoftwareio/simple-qrcode/438dfea2206e7268af265a6619cb40bea92732e3.zip from cache
Loading from cache
 Extracting archiveExecuting command (CWD): unzip -qq  '/Users/me/Env/mine/www/myprojectdir/vendor/simplesoftwareio/simple-qrcode/314484bfaf224d73a3220c1152a326a9' -d '/Users/me/Env/mine/www/myprojectdir/vendor/composer/9bdc8e1e'
    REASON: Required by the root package: Install command rule (install simplesoftwareio/simple-qrcode 1.3.0|install simplesoftwareio/simple-qrcode 1.3.1|install simplesoftwareio/simple-qrcode 1.3.2|install simplesoftwareio/simple-qrcode 1.3.3)

Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Package phpoffice/phpexcel is abandoned, you should avoid using it. Use phpoffice/phpspreadsheet instead.
Package illuminate/html is abandoned, you should avoid using it. Use laravelcollective/html instead.
Package elibyy/laravel-tcpdf is abandoned, you should avoid using it. Use elibyy/tcpdf-laravel instead.
Package caouecs/laravel4-lang is abandoned, you should avoid using it. Use caouecs/laravel-lang instead.
Reading /Users/me/Env/mine/www/myprojectdir/vendor/composer/installed.json
Executing command (/Users/me/Env/mine/www/myprojectdir/vendor/elasticquent/elasticquent): git log -n1 --pretty=%ct '46c838bc1de1f0a2e3e4d28254700171aa51df03'
Writing lock file
Generating autoload files

我的第三个问题

如何解决这个问题?要仅安装mycompany/qlog软件包而不接触任何其他不相关的软件包?

我在网上搜索了答案,并问IRC和Gitter运气不好,希望有人能启发我。

更新

我尝试安装其他软件包,所有软件包都会触发相同的错误结果。因此,显然要安装的内容与此错误无关。

0 个答案:

没有答案