我无法在symfony3.1项目中安装JMSSerializerBundle

时间:2017-06-23 00:17:26

标签: symfony jmsserializerbundle symfony-3.1

我正在尝试在symfony3.1项目中安装JMSSerializerBundle,但是我收到此错误

命令:

php ../composer.phar require jms/serializer-bundle -vvv
  

将版本^ 2.0用于jms / serializer-bundle
    [UnexpectedValueException]
    无法解析版本约束更新:无效的版本字符串“update”

     

异常追踪:    ()at phar:// C:/xampp/htdocs/composer.phar/vendor/composer/semver/src/VersionParser.php:485    Phar:/ C:/xampp / htdocs / composer.phar / vendor / composer / semver / src / VersionParser.php中的Composer \ Semver \ VersionParser-> parseConstraint():249    在Phar:/ C:/xampp / htdocs / composer.phar / src / Composer / Package / Version / VersionParser.php中的Composer \ Semver \ VersionParser-> parseConstraints():27    在phar:// C:/xampp / htdocs / composer.phar / src / Composer / Command / RequestCommand.php上的Composer \ Package \ Version \ VersionParser-> parseConstraints():126    Composr \ Command \ RequireCommand->执行()at phar:// C:/xampp/htdocs/composer.phar/vendor/symfony/console/Command/Command.php:267    Symfony \ Component \ Console \ Command \ Command-> run()at phar:// C:/xampp/htdocs/composer.phar/vendor/symfony/console/Application.php:846    phar:// C:/xampp / htdocs / composer.phar    Symfony \ Component \ Console \ Application-> doRun()at phar:// C:/xampp/htdocs/composer.phar/src/Composer/Console/Application.php:227    Composr \ Console \ Application-> doRun()at phar:// C:/xampp/htdocs/composer.phar/vendor/symfony/console/Application.php:122

1 个答案:

答案 0 :(得分:0)

我不确定你为什么会看到这个问题,但是你可以尝试这些命令:

concurrently "tsc -w -p ./Project1" "tsc -w -p ./Project2"

按此顺序。我想也许你的作曲家版本已经过时了,但不确定是否会解决问题。如果有,请告诉我。

基于评论的正确命令将是:

php ../composer.phar self-update
php ../composer.phar update
php ../composer.phar require jms/serializer-bundle

看看是否有效。