Skip to content

Commit

Permalink
feat(angular-cli): Add a postinstall warning for Node 4 deprecation.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hansl committed Jan 31, 2017
1 parent 3e03c97 commit 24b2b45
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/angular-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
"node": ">= 4.1.0",
"npm": ">= 3.0.0"
},
"scripts": {
"postinstall": "node ./scripts/install.js"
},
"author": "Angular Authors",
"license": "MIT",
"bugs": {
Expand Down
23 changes: 23 additions & 0 deletions packages/angular-cli/scripts/install.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env node
/* eslint-disable no-console */
import {stripIndent} from 'common-tags';
import {yellow} from 'chalk';

const SemVer = require('semver').SemVer;

const version = new SemVer(process.version);
if (version.compare('6.9.0') < 0) {
console.log(yellow(stripIndent`
We detected that you are using Node v${version.version}. Unfortunately, this version will not
be officially supported when the Angular CLI is released. The official Node version that will
be supported is 6.9 and greater. This beta release (Beta.27) will be the last release to
support Node 4.
This is to ensure that we can provide our users with better support for the upcoming releases.
Many of our dependencies are moving to deprecating Node 4 already and that would mean that we
could not update them to the latest versions which might have bug fixes and new useful features.
As a forewarning, We are also moving to "@angular/cli" with the next release, which will only
support Node 6.9 and greater. This package will be officially deprecated shortly after.
`));
}

0 comments on commit 24b2b45

Please sign in to comment.