From fb6335ab60265e2341f4e28c98de0910d24e82fc Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Thu, 21 Jan 2016 14:15:32 -0800 Subject: [PATCH] build(gulp): fail hard w/ legacy node version and provide clear upgrade instructions Closes #6213 --- tools/check-environment.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/check-environment.js b/tools/check-environment.js index b10be47f4c..7c21b88652 100644 --- a/tools/check-environment.js +++ b/tools/check-environment.js @@ -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');