提问者:小点点

当--no dev被传递时,编写器在php版本中失败


我有一个编写器文件,其中包含需要PHP的开发人员依赖项

编写器文件:

{
    "config": {
        "vendor-dir": "./vendor/"
    },
    "require": {
        "symfony/config" : "dev-master",
        "twig/twig": "1.15.1",
        "leafo/lessphp": "v0.4.0",
        "simplepie/simplepie": "dev-master",
        "contao/idna": "dev-master",
        "swiftmailer/swiftmailer": "5.3.*@dev",
        "james-heinrich/getid3": "dev-master",
        "pda/pheanstalk": "v2.1.0",
        "monolog/monolog": "1.9.1",
        "pimple/pimple": ">1.0.0",
        "doctrine/orm": "2.4.*",
        "ircmaxell/password-compat": "1.0.3",
        "raven/raven": "dev-curl-async",
        "elasticsearch/elasticsearch": "~1.0",
        "guzzle/guzzle": "3.9.2"
    },
    "require-dev": {
        "codeception/codeception": "2.1.*@dev"
    }
}

Codeception对PHP5.4有要求。0,当我运行composer update--no dev时,我得到以下信息:

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

  Problem 1
    - Installation request for codeception/codeception 2.1.*@dev -> satisfiable by codeception/codeception[2.1.x-dev].
    - codeception/codeception 2.1.x-dev requires php >=5.4.0 -> no matching package found.

composer是否应该跳过我明确告诉它不要安装的包的需求检查?我尝试过传递——忽略平台需求,但没有成功。

使现代化

在PHP 5.3.10上运行它似乎完全忽略了--no-dev选项,并报告它正在安装它们:

composer update --no-dev
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 codeception/codeception 2.1.*@dev -> satisfiable by codeception/codeception[2.1.x-dev].
    - codeception/codeception 2.1.x-dev requires php >=5.4.0 -> no matching package found.

共2个答案

匿名用户

您需要使用--no-dev来不安装dev包。

匿名用户

解决了的!!!

似乎我的composer文件是一个bash脚本,它没有将参数传递给composer。phar文件正确。

这个问题是我自己造成的。