fxpio / composer-asset-plugin

NPM/Bower Dependency Manager for Composer
MIT License
893 stars 156 forks source link

Invalid version string "1.1.0,,<2.0" #305

Open Zaporozhec7 opened 7 years ago

Zaporozhec7 commented 7 years ago

When I try to update packages, was faced with this issue:

[UnexpectedValueException]
Could not parse version constraint >=1.1.0,,<2.0: Invalid version string "1.1.0,,<2.0"

While trying to find cause of this exception i was found that it was caused by whitespace after comma. And i'm not sure, but seems that constraint was created from constraint "^3.0.1".

In my case, as temporary solution, was help adding:

$range = str_replace(', ', ',', $range);

After this line

Zaporozhec7 commented 7 years ago

Seems that was wrong solution, although exception dissapear, appear many strange bugs.

If that will help to fix that issue (exception), seems it caused by this package - https://github.com/uxsolutions/bootstrap-datepicker

nfodev commented 7 years ago

I had the same issue, also bootstrap-datepicker (v1.7.1) I added this simple code as a dirty workaround for now:

(composer-asset-plugin/Converter/SemverConverter.php line 65)

if ($range === '>=1.1.0, <2.0') {
    $range = '>=1.1.0,<2.0';
}

I'm not sure if it's a wrong range used by bootstrap-datepicker or if it should be changed in composer-asset-plugin..?

francoispluchino commented 7 years ago

If it works for NPM or Bower, it's a bug.

zhdanovartur commented 6 years ago

So?

francoispluchino commented 6 years ago

If you have a patch, I take. It happens in the SemverConverter class