build: improve the environmental check and warnings

- we now correctly print errors even on old Node versions
- we print error messages even when node_modules are missing or messed up
- error messages looks better

Closes #5230
This commit is contained in:
Igor Minar
2015-11-14 08:10:31 -08:00
committed by Jeremy Elbourn
parent 1417e12f28
commit 7f783289ab
2 changed files with 56 additions and 11 deletions

View File

@ -1,5 +1,11 @@
'use strict';
// THIS CHECK SHOULD BE THE FIRST THING IN THIS FILE
// This is to ensure that we catch env issues before we error while requiring other dependencies.
require('./tools/check-environment')(
{requiredNpmVersion: '>=2.14.7 <3.0.0', requiredNodeVersion: '>=4.2.1 <5.0.0'});
var del = require('del');
var gulp = require('gulp');
var gulpPlugins = require('gulp-load-plugins')();
@ -26,8 +32,6 @@ var dartSdk = require('./tools/build/dart');
var browserProvidersConf = require('./browser-providers.conf.js');
require('./tools/check-environment')(
{requiredNpmVersion: '>=2.14.7', requiredNodeVersion: '>=4.2.1'});
var cliArgs = minimist(process.argv.slice(2));