build(gulp): fail hard w/ legacy node version and provide clear upgrade instructions

Closes #6213
This commit is contained in:
Igor Minar 2016-01-21 14:15:32 -08:00 committed by Igor Minar
parent 89bd008445
commit fb6335ab60
1 changed files with 10 additions and 2 deletions

View File

@ -17,8 +17,8 @@ var semver;
var issues = [];
// coarse Node version check
if (process.version[1] !== '4') {
issues.push("Angular 2 build currently requires Node 4. Use nvm to update your node version.");
if (Number.parseInt(process.version[1], 10) < 5) {
issues.push("Angular 2 build currently requires Node 5. Use nvm to update your node version.");
}
try {
@ -27,6 +27,14 @@ try {
issues.push("Looks like you are missing some npm dependencies. Run: npm install");
}
if (issues.length) {
printWarning(issues);
console.error("Your environment doesn't provide the prerequisite dependencies.\n" +
"Please fix the issues listed above and then rerun the gulp command.\n" +
"Check out https://github.com/angular/angular/blob/master/DEVELOPER.md for more info.");
process.exit(1);
}
// wrap in try/catch in case someone requires from within that file
try {
checkNodeModules = require('./npm/check-node-modules.js');