Fixed a bug caused by recently throw added in semver

The newest semver module version throws when calling `toComparators` with an invalid semver range (`invalid comparator`).