我在尝试安装Behat + Mink + Selenium时遇到错误。可能是什么解决方案?
php composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for symfony/framework-standard-edition 2.4.x-dev -> satisfiable by symfony/framework-standard-edition[2.4.x-dev].
- symfony/framework-standard-edition 2.4.x-dev requires behat/behat 2.4.*@stable -> no matching package found.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Composer.json:
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"minimum-stability": "dev",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "~2.4",
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": "~1.2",
"twig/extensions": "~1.0",
"symfony/assetic-bundle": "~2.3",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~2.3",
"sensio/framework-extra-bundle": "~3.0",
"sensio/generator-bundle": "~2.3",
"incenteev/composer-parameter-handler": "~2.0",
"behat/behat": "2.4.*@stable",
"behat/mink": "1.4.*@stable",
"behat/mink-extension": "*",
"behat/mink-goutte-driver": "*",
"behat/mink-selenium2-driver": "*",
"behat/symfony2-extension": "*",
"behat/mink-browserkit-driver": "*",
"behat/mink-sahi-driver": "*",
"phpunit/phpunit": "3.7.*"
},
"scripts": {
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
]
},
"config": {
"bin-dir": "bin/"
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.4-dev"
}
}
}
我正在关注这两个博客来安装它:
答案 0 :(得分:2)
IMO,你已经注册了太多的软件包。例如,behat是symfony2-extension的依赖项。所以,只需要需要symfony2-extension和behat将是必需的:)当您明确要求所有内容时,您需要检查每个包约束是否可以在packagist上一起工作(这可能会变得很痛苦)...
对于Symfony 2.4项目,我会使用以下包:
"require-dev": {
"behat/symfony2-extension": "~1.1",
"behat/mink-extension": "~1.3",
"behat/mink-selenium2-driver": "~1.1",
"behat/mink-goutte-driver": "~1.0",
}
答案 1 :(得分:0)
我建议运行composer require,然后在安装之前执行一个作曲家更新,以便所有依赖项都处于更新版本。所以下面的依赖项对我的symfony2.8项目是有用的:
composer update
composer require behat/behat
composer require behat/symfony2-extension
composer require behat/mink
composer require behat/mink-browserkit-driver
composer require behat/mink-extension
composer require behat/mink-goutte-driver
composer require behat/mink-selenium2-driver
composer require emuse/behat-html-formatter
composer require coduo/php-matcher