So I was just about to deploy some changes for the first time in some months, and I get this error back:
[UnexpectedValueException]
Could not parse version constraint ^1.2.2: Invalid version string "^1.2.2"
After some digging, I found the line in my composer.lock file:
{
"_readme": [
...
],
"hash": "NotTellingYou",
"packages": [
{
...
},
....
"require": {
"nikic/php-parser": "^1.2.2",
"php": ">=5.3.3",
"symfony/console": "~2.1",
"symfony/filesystem": "~2.1",
"symfony/finder": "~2.1"
},
But ehhh... How do I make the string the "correct" then? I know the newest version is 1.3, but is it okay for me to change that? Shouldn't it be automatic when running composer update
?
change "nikic/php-parser": "^1.2.2" to "nikic/php-parser": "1.*",
Update the Composer version you are using. The feature of using the
^
operator has been added in December 2014, so everyone should have gotten an updated copy of Composer by nowThis is the key to prevent incompatibility issues. Note that Composer is still in development, and there are some alpha releases. Using it means to also update it regularly.