Symfony 2执行“composer install”命令时发生错误

时间:2014-02-18 20:55:27

标签: php symfony doctrine-orm composer-php

Symfony 2.4

当我运行composer install时,我看到了这样的错误:

Generating autoload files

Fatal error: Class 'Doctrine\ORM\Tools\Console\Command\ClearCache\CollectionRegionCommand' not found in /Users/vpx/www/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/CollectionRegionDoctrineCommand.php on line 29
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception



  [RuntimeException]                                                         
  An error occurred when executing the "'cache:clear --no-warmup'" command.  

将composer.json从"doctrine/orm": "~2.2,>=2.2.3"更改为"doctrine/orm": "~2.2.3"之后。那是为什么?

2 个答案:

答案 0 :(得分:0)

尝试运行composer update而不是composer install

如果不起作用,请尝试将"doctrine/orm": "~2.3.3"替换为"doctrine/orm": "dev-master"中的composer.json

答案 1 :(得分:0)

您确实以您可能没有看到的方式更改版本。

"doctrine/orm": "~2.2,>=2.2.3"

这允许版本从2.2.3(最后限制)开始,不包括3.0,但是2.9999.9999。

"doctrine/orm": "~2.2.3"

这允许版本从2.2.3开始,不包括2.3.0,但不包括2.2.9999。

因此,您的更改实际上不允许版本2.3。*及更高版本,这可能是失败的原因,因为该特定库已经具有版本2.4.2,现在不允许。

您可能应该更新该版本要求,因为执行某些更新的安装后命令似乎不适用于此库的2.2.x版。我建议至少使用~2.3,因为这也会排除2.2.2及更低版本之前的版本。