diff --git a/lib/utils/unsupported.js b/lib/utils/unsupported.js index 71a304030e242..a1e51f495da52 100644 --- a/lib/utils/unsupported.js +++ b/lib/utils/unsupported.js @@ -1,5 +1,6 @@ 'use strict' var semver = require('semver') +var earliestSupportedNode = '9.3.0' var supportedNode = [ {ver: '6', min: '6.0.0'}, {ver: '8', min: '8.0.0'}, @@ -13,10 +14,11 @@ var knownBroken = '<6.2.0 || 9.0 - 9.2' var checkVersion = exports.checkVersion = function (version) { var versionNoPrerelease = version.replace(/-.*$/, '') + var isExplicitlySupportedNode = semver.satisfies(versionNoPrerelease, supportedNode.map(function (n) { return '^' + n.min }).join('||')) return { version: versionNoPrerelease, broken: semver.satisfies(versionNoPrerelease, knownBroken), - unsupported: !semver.satisfies(versionNoPrerelease, supportedNode.map(function (n) { return '^' + n.min }).join('||')) + unsupported: !isExplicitlySupportedNode || !semver.gte(versionNoPrerelease, earliestSupportedNode) } }