Last change
on this file since 8d391a1 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.6 KB
|
Line | |
---|
1 | #!/usr/bin/env node
|
---|
2 | 'use strict';
|
---|
3 |
|
---|
4 | // Provide a title to the process in `ps`.
|
---|
5 | // Due to an obscure Mac bug, do not start this title with any symbol.
|
---|
6 | try {
|
---|
7 | process.title = 'ng ' + Array.from(process.argv).slice(2).join(' ');
|
---|
8 | } catch (_) {
|
---|
9 | // If an error happened above, use the most basic title.
|
---|
10 | process.title = 'ng';
|
---|
11 | }
|
---|
12 |
|
---|
13 | // This node version check ensures that extremely old versions of node are not used.
|
---|
14 | // These may not support ES2015 features such as const/let/async/await/etc.
|
---|
15 | // These would then crash with a hard to diagnose error message.
|
---|
16 | // tslint:disable-next-line: no-var-keyword
|
---|
17 | var version = process.versions.node.split('.').map((part) => Number(part));
|
---|
18 | if (version[0] % 2 === 1 && version[0] > 14) {
|
---|
19 | // Allow new odd numbered releases with a warning (currently v15+)
|
---|
20 | console.warn(
|
---|
21 | 'Node.js version ' +
|
---|
22 | process.version +
|
---|
23 | ' detected.\n' +
|
---|
24 | 'Odd numbered Node.js versions will not enter LTS status and should not be used for production.' +
|
---|
25 | ' For more information, please see https://nodejs.org/en/about/releases/.',
|
---|
26 | );
|
---|
27 |
|
---|
28 | require('../lib/init');
|
---|
29 | } else if (
|
---|
30 | version[0] < 12 ||
|
---|
31 | version[0] === 13 ||
|
---|
32 | (version[0] === 12 && version[1] < 14) ||
|
---|
33 | (version[0] === 14 && version[1] < 15)
|
---|
34 | ) {
|
---|
35 | // Error and exit if less than 12.14 or 13.x or less than 14.15
|
---|
36 | console.error(
|
---|
37 | 'Node.js version ' +
|
---|
38 | process.version +
|
---|
39 | ' detected.\n' +
|
---|
40 | 'The Angular CLI requires a minimum Node.js version of either v12.14 or v14.15.\n\n' +
|
---|
41 | 'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n',
|
---|
42 | );
|
---|
43 |
|
---|
44 | process.exitCode = 3;
|
---|
45 | } else {
|
---|
46 | require('../lib/init');
|
---|
47 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.