#!/usr/bin/env node 'use strict'; process.title = 'ionic'; process.on('unhandledRejection', function(r) { console.error(r); }); var semver = require('semver'); if (semver.lt(process.version, 'v6.4.0')) { console.log('ERR: Your Node.js version is ' + process.version + '. Please update to the latest Node 8 LTS.'); process.exit(1); } var bootstrap = require('@ionic/cli-utils/bootstrap'); bootstrap.detectLocalCLI().then(function(localPath) { var cli = require(localPath); process.env.IONIC_CLI_LOCAL = localPath; process.env.IONIC_CLI_BIN = __filename; cli.run(process.argv, process.env); }, function(err) { var cli = require('../'); if (typeof err !== 'string') { throw err; } process.env.IONIC_CLI_LOCAL_ERROR = err; process.env.IONIC_CLI_BIN = __filename; cli.run(process.argv, process.env); });