Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] minVersion is failing on ranges like ^0 >=0.1.2 #330

Closed
SkReD opened this issue Jun 1, 2020 · 2 comments
Closed

[BUG] minVersion is failing on ranges like ^0 >=0.1.2 #330

SkReD opened this issue Jun 1, 2020 · 2 comments

Comments

@SkReD
Copy link

SkReD commented Jun 1, 2020

What / Why

.minVersion is failing with error on range ^0 >=0.1.2. Workaround isminVersion(validRange('<range>'))

How

Current Behavior

Failing with undefined error

Expected Behavior

Returns 0.1.2

References

semver version - 7.3.2

@dalyr95
Copy link

dalyr95 commented Aug 24, 2020

Got the same issue in the above Issue with npm/cli and it's engines. minVersion returns null

const semver = require('semver');
undefined
> semver.minVersion("6 >=6.2.0 || 8 || >=9.3.0");
null
> semver.minVersion(">=6.2.0 || 8 || >=9.3.0");
SemVer {
  options: { loose: false, includePrerelease: false },
  loose: false,
  includePrerelease: false,
  raw: '6.2.0',
  major: 6,
  minor: 2,
  patch: 0,
  prerelease: [],
  build: [],
  version: '6.2.0'
}
> semver.minVersion("6 || >=6.2.0 || 8 || >=9.3.0");
SemVer {
  options: { loose: false, includePrerelease: false },
  loose: false,
  includePrerelease: false,
  raw: '6.0.0',
  major: 6,
  minor: 0,
  patch: 0,
  prerelease: [],
  build: [],
  version: '6.0.0'
}

@lukekarrys
Copy link
Contributor

Fixed by #341

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants