When using a nightly version of Yarn (via yarn policies set-version nightly), Yarn uses a non-semver version, e.g. 1.17.0-20190524.0703. This causes the Prerequisite check, Check yarn version fail.
yarn policies set-version nightlynp
np should work with a nightly version of Yarn.
np - 5.0.2
Node.js - 11.15.0
npm - 6.9.0
Git - 2.21.0
OS - darwin 18.6.0 (10.14.6 Beta)
We currently use semver for version parsing, which can't handle versions like 1.17.0-20190524.0703 and considers those to be invalid. However, @hapi/somever appears to be a viable replacement for semver (or at least for parsing versions), and can also correctly parse such versions.
@dotconnor I'd happily review and accept a PR migrating np's version parsing to use @hapi/somever instead of semver 馃檭
@itaisteinherz It doesn't look like @hapi/somever is compatible with how yall are doing version checking.
It doesn't look like
@hapi/someveris compatible with how yall are doing version checking.
Why not? From a quick look at the tests, it seems like we'll be able to use @hapi/somever for cleaning the given version in the constructor, validating versions and comparing versions using ranges, which is nearly everything we need. We could also just use @hapi/somever in the constructor of Version to clean the given version using somever.version(v).