Skip to content

Commit fb6335a

Browse files
committed
build(gulp): fail hard w/ legacy node version and provide clear upgrade instructions
Closes angular#6213
1 parent 89bd008 commit fb6335a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tools/check-environment.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ var semver;
1717
var issues = [];
1818

1919
// coarse Node version check
20-
if (process.version[1] !== '4') {
21-
issues.push("Angular 2 build currently requires Node 4. Use nvm to update your node version.");
20+
if (Number.parseInt(process.version[1], 10) < 5) {
21+
issues.push("Angular 2 build currently requires Node 5. Use nvm to update your node version.");
2222
}
2323

2424
try {
@@ -27,6 +27,14 @@ try {
2727
issues.push("Looks like you are missing some npm dependencies. Run: npm install");
2828
}
2929

30+
if (issues.length) {
31+
printWarning(issues);
32+
console.error("Your environment doesn't provide the prerequisite dependencies.\n" +
33+
"Please fix the issues listed above and then rerun the gulp command.\n" +
34+
"Check out https://github.com/angular/angular/blob/master/DEVELOPER.md for more info.");
35+
process.exit(1);
36+
}
37+
3038
// wrap in try/catch in case someone requires from within that file
3139
try {
3240
checkNodeModules = require('./npm/check-node-modules.js');

0 commit comments

Comments
 (0)