【问题标题】:Composer. Errror: "Could not parse version constraint..." on valid composer.json作曲家。错误:有效 composer.json 上的“无法解析版本约束...”
【发布时间】:2015-10-21 23:11:46
【问题描述】:

问题:Get 无法解析有效 composer.json 的版本约束。

我有 /srv/www/site/api/composer.json/srv/www/site/frontend/composer.json。目录 /srv/www/site/api/ 和 /srv/www/site/frontend/ 中没有 composer.lockvendor/

Api composer.json 和前端 composer.json 包含相同的文本:

{
    "minimum-stability": "stable",
    "require":
    {
        "doctrine/dbal": "*"
    },
    "autoload":
    {
        "psr-4":
        {
            "app\\": "./"
        }
    }
}

首先。我跑。

cd /srv/www/site/api
composer install

并得到结果。好的。

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
  - Installing doctrine/lexer (v1.0.1)
    Loading from cache

  - Installing doctrine/annotations (v1.2.7)
    Loading from cache

  - Installing doctrine/cache (v1.4.2)
    Loading from cache

  - Installing doctrine/collections (v1.3.0)
    Loading from cache

  - Installing doctrine/inflector (v1.0.1)
    Loading from cache

  - Installing doctrine/common (v2.5.1)
    Loading from cache

  - Installing doctrine/dbal (v2.5.2)
    Loading from cache

doctrine/dbal suggests installing symfony/console (For helpful console commands such as SQL execution and import of files.)
Generating autoload files
noopic@WhiteBear:/srv/www/dev.laronet.ee/api$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files

第二。我跑。

cd /srv/www/site/frontend
composer install

并得到结果。错误。

  [UnexpectedValueException]                                       
  Could not parse version constraint >: Invalid version string ""  



install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [packages1] ... [packagesN]

如何解决?这是错误还是我的失败?

作曲家版本 f85d965732d9505b69242a070dc0b381c9f6bbab

【问题讨论】:

    标签: composer-php


    【解决方案1】:

    只需删除用户目录中的 .composer 文件夹即可。对我来说 /home/noopic/.composer。在两个目录中安装成功。

    但是如果我在前端运行

    composer update
    

    得到同样的错误。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-16
      • 1970-01-01
      • 2012-11-11
      • 1970-01-01
      • 1970-01-01
      • 2013-11-24
      相关资源
      最近更新 更多