作曲家更新 - 无法在http://packagist.org:

时间:2016-03-30 07:23:26

标签: symfony laravel composer-php updates

当我在Laravel 5.1上进行作曲家更新时,会出现此错误

> Downloading http://packagist.org/p/symfony/polyfill-mbstring$a9a5f6e4a8af44008f50a8c0059a6d1a61b1f692627fb41f0cc1f3e8bbfb7205.json
> Writing /root/.composer/cache/repo/https---packagist.org/provider-symfony$polyfill-mbstring.json into cache



  [RuntimeException]
  Could not load package shopware/shopware in http://packagist.org: [UnexpectedValueException] Could not parse version constraint ~v
  2.0.0-rc1: Invalid version string "~v2.0.0-rc1"




[UnexpectedValueException]
  Could not parse version constraint ~v2.0.0-rc1: Invalid version string "~v2.0.0-rc1"

当我在缓存文件夹

上跟踪它时
"require-dev": {
                    "phpunit\/phpunit": "~4.5",
                    "phpunit\/dbunit": "~1.3",
                    "behat\/mink": "~1.7",
                    "behat\/mink-extension": "~2.1",
                    "behat\/mink-goutte-driver": "~1.2",
                    "behat\/mink-selenium2-driver": "~1.3",
                    "symfony\/dom-crawler": "~2.8",
                    "behat\/behat": "~3.1",
                    "sensiolabs\/behat-page-object-extension": "~v2.0.0-rc1"
                },

它不在我的require包中:composer.json 它来自symfony / polyfill-mbstring 但为什么在json文件上他们得到了这个?

"packages": {
    "shopware\/shopware": {
        "5.2.x-dev": {
            "name": "shopware\/shopware",
            "description": "Shopware is the next generation of open source e-commerce software made in Germany",
            "keywords": ["shop", "shopware"],
            "homepage": "http:\/\/www.shopware.com",
            "version": "5.2.x-dev",
            "version_normalized": "5.2.9999999.9999999-dev",
            "license": ["AGPL-3.0", "proprietary"],
            "authors": [],
            "source": {
                "type": "git",
                "url": "https:\/\/github.com\/shopware\/shopware.git",
                "reference": "4c4817979a98144e57d9eebc5aa166795e378a1c"
            },
            "dist": {
                "type": "zip",
                "url": "https:\/\/api.github.com\/repos\/shopware\/shopware\/zipball\/4c4817979a98144e57d9eebc5aa166795e378a1c",
                "reference": "4c4817979a98144e57d9eebc5aa166795e378a1c",
                "shasum": ""
            },
            "type": "project",
            "time": "2016-03-29T06:54:10+00:00",
            "autoload": {
                "psr-0": {
                    "Doctrine\\Common\\Proxy\\AbstractProxyFactory": "engine\/Library\/",
                    "Doctrine\\ORM\\Persisters\\Entity\\BasicEntityPersister": "engine\/Library\/",
                    "Shopware": "engine\/",
                    "Enlight": "engine\/Library\/",
                    "Zend": "engine\/Library\/",
                    "JSMin": "engine\/Library\/minify\/"
                },
                "classmap": ["engine\/Shopware\/Core\/"],
                "files": ["engine\/Shopware\/Application.php"]
            },
            "include-path": ["engine\/Library\/"],
            "require": {
                "php": ">=5.5.9",
                "ext-curl": "*",
                "ext-mbstring": "*",
                "ext-gd": "*",
                "doctrine\/common": "2.5.1",
                "doctrine\/dbal": "2.5.1",
                "doctrine\/orm": "2.5.1",
                "beberlei\/assert": "2.4.0",
                "zendframework\/zend-escaper": "2.5.1",
                "oyejorge\/less.php": "1.7.0.5",
                "guzzlehttp\/guzzle": "5.1.0",
                "egulias\/email-validator": "1.2.9",
                "symfony\/http-kernel": "2.8.0",
                "symfony\/config": "2.8.0",
                "symfony\/dependency-injection": "2.8.0",
                "symfony\/validator": "2.8.0",
                "symfony\/filesystem": "2.8.0",
                "symfony\/finder": "2.8.0",
                "symfony\/console": "2.8.0",
                "symfony\/polyfill-php56": "1.0.0",
                "monolog\/monolog": "1.17.2",
                "doctrine\/cache": "1.6.0",
                "paragonie\/random_compat": "1.1.5",
                "symfony\/form": "2.8.0",
                "league\/flysystem": "1.0.18",
                "elasticsearch\/elasticsearch": "2.1.5",
                "ongr\/elasticsearch-dsl": "v2.0.0"
            },
            "require-dev": {
                "phpunit\/phpunit": "~4.5",
                "phpunit\/dbunit": "~1.3",
                "behat\/mink": "~1.7",
                "behat\/mink-extension": "~2.1",
                "behat\/mink-goutte-driver": "~1.2",
                "behat\/mink-selenium2-driver": "~1.3",
                "symfony\/dom-crawler": "~2.8",
                "behat\/behat": "~3.1",
                "sensiolabs\/behat-page-object-extension": "~v2.0.0-rc1"
            },
            "replace": {
                "symfony\/polyfill-php55": "~1.0",
                "symfony\/polyfill-mbstring": "~1.0"
            },
            "uid": 588566
        }, bla ...............

3 个答案:

答案 0 :(得分:3)

我有完全相同的错误

./composer.phar selfupdate为我解决问题。

答案 1 :(得分:1)

似乎是作曲家本身的问题,我们的全球作曲家遇到了同样的问题。 您需要清除/root/.composer/中的缓存和供应商映射并更新编写器本身:

cd /root
curl -sS https://getcomposer.org/installer | sudo php --
php composer.phar global update
rm composer.phar

答案 2 :(得分:0)

这是在Composer中的一个问题,但与Shopware上游软件包有关。

以下提交在3月29日打破了这种依赖: https://github.com/shopware/shopware/commit/e44e4a7d788675489aadbd664c50a7cfc47e0f05

以下提交在一天后修复: https://github.com/shopware/shopware/commit/0cec1d69e972150b3d1fa71b82e621031ff341e3

因此,如果您仍遇到此问题,请使用以下命令进行修复:

composer clear-cache
composer update shopware/shopware