Skip to content

Commit 8da772b

Browse files
committed
feat(angular-cli): Add a postinstall warning for Node 4 deprecation.
BREAKING CHANGE: Node < 6.9 will be deprecated soon, and this will show a warning to users. Moving forward, that warning will be moved to an error with the next release.
1 parent 3e03c97 commit 8da772b

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

packages/angular-cli/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
"node": ">= 4.1.0",
2020
"npm": ">= 3.0.0"
2121
},
22+
"scripts": {
23+
"postinstall": "node ./scripts/install.js"
24+
},
2225
"author": "Angular Authors",
2326
"license": "MIT",
2427
"bugs": {
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env node
2+
/* eslint-disable no-console */
3+
import {stripIndent} from 'common-tags';
4+
import {yellow} from 'chalk';
5+
6+
const SemVer = require('semver').SemVer;
7+
8+
const version = new SemVer(process.version);
9+
if (version.compare('6.9.0') < 0) {
10+
console.log(yellow(stripIndent`
11+
We detected that you are using Node v${version.version}. Unfortunately, this version will not
12+
be officially supported when the Angular CLI is released. The official Node version that will
13+
be supported is 6.9 and greater. This beta release (Beta.27) will be the last release to
14+
support Node 4.
15+
16+
This is to ensure that we can provide our users with better support for the upcoming releases.
17+
Many of our dependencies are moving to deprecating Node 4 already and that would mean that we
18+
could not update them to the latest versions which might have bug fixes and new useful features.
19+
20+
As a forewarning, We are also moving to "@angular/cli" with the next release, which will only
21+
support Node 6.9 and greater. This package will be officially deprecated shortly after.
22+
`));
23+
}

0 commit comments

Comments
 (0)