
var semver = require('semver')

var requiredVersion = require('../package.json').engines.node
function checkNodeVersion (wanted, id) {
  if (!semver.satisfies(process.version, wanted)) {
    console.log('\x1b[91m%s\x1B[0m',
      'You are using Node ' + process.version + ', but this version of ' + id +
      ' requires Node ' + wanted + '.\nPlease upgrade your Node version.'
    )
    process.exit(1)
  }
}

checkNodeVersion(requiredVersion, '`node uploadAliyunCDN.js`')
