From point 9 of the SemVer spec:
A pre-release version indicates that the version is unstable and might not satisfy the intended compatibility requirements as denoted by its associated normal version. Examples: 1.0.0-alpha, 1.0.0-alpha.1, 1.0.0-0.3.7, 1.0.0-x.7.z.92.
However, the package npm uses to process semver values provides no way to specify a range which excludes pre-release versions.
‣ semver --range '~1.2.3' 1.2.3 1.2.4-alpha 1.2.4 1.3.0-alpha 1.3.0 2.0.0-alpha
1.2.3
1.2.4-alpha
1.2.4
‣ semver --range '^1.2.3' 1.2.3 1.2.4-alpha 1.2.4 1.3.0-alpha 1.3.0 2.0.0-alpha
1.2.3
1.2.4-alpha
1.2.4
1.3.0-alpha
1.3.0
‣ semver --range '1.2.x' 1.2.3 1.2.4-alpha 1.2.4 1.3.0-alpha 1.3.0 2.0.0-alpha
1.2.3
1.2.4-alpha
1.2.4
‣ semver --range '<1.3.0' 1.2.3 1.2.4-alpha 1.2.4 1.3.0-alpha 1.3.0 2.0.0-alpha
1.2.3
1.2.4-alpha
1.2.4
‣ semver --range '<1.3.0-0' 1.2.3 1.2.4-alpha 1.2.4 1.3.0-alpha 1.3.0 2.0.0-alpha
1.2.3
1.2.4-alpha
1.2.4
‣ semver --range '<=1.3.0-0' 1.2.3 1.2.4-alpha 1.2.4 1.3.0-alpha 1.3.0 2.0.0-alpha
1.2.3
1.2.4-alpha
1.2.4
‣ semver --range '<1.3.0' 1.2.3 1.2.4-alpha 1.2.4 1.3.0-alpha 1.3.0 2.0.0-alpha