1 | #!/usr/bin/env node
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | 'use strict';
|
13 |
|
14 | const path = require('path');
|
15 |
|
16 |
|
17 | if (process.cwd().split(path.sep).includes('google3')) {
|
18 | console.error(
|
19 | 'This is the external Angular CLI, but you appear to be running in google3. There is a separate, internal version of the CLI which should be used instead. See http://go/angular/cli.',
|
20 | );
|
21 | process.exit();
|
22 | }
|
23 |
|
24 |
|
25 |
|
26 | try {
|
27 | process.title = 'ng ' + Array.from(process.argv).slice(2).join(' ');
|
28 | } catch (_) {
|
29 |
|
30 | process.title = 'ng';
|
31 | }
|
32 |
|
33 | const rawCommandName = process.argv[2];
|
34 |
|
35 | if (rawCommandName === '--get-yargs-completions' || rawCommandName === 'completion') {
|
36 |
|
37 |
|
38 | require('./bootstrap');
|
39 |
|
40 | return;
|
41 | }
|
42 |
|
43 |
|
44 |
|
45 |
|
46 | var version = process.versions.node.split('.').map((part) => Number(part));
|
47 | if (version[0] % 2 === 1) {
|
48 |
|
49 | console.warn(
|
50 | 'Node.js version ' +
|
51 | process.version +
|
52 | ' detected.\n' +
|
53 | 'Odd numbered Node.js versions will not enter LTS status and should not be used for production.' +
|
54 | ' For more information, please see https://nodejs.org/en/about/previous-releases/.',
|
55 | );
|
56 |
|
57 | require('./bootstrap');
|
58 | } else if (version[0] < 18 || (version[0] === 18 && version[1] < 13)) {
|
59 |
|
60 | console.error(
|
61 | 'Node.js version ' +
|
62 | process.version +
|
63 | ' detected.\n' +
|
64 | 'The Angular CLI requires a minimum Node.js version of v18.13.\n\n' +
|
65 | 'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n',
|
66 | );
|
67 |
|
68 | process.exitCode = 3;
|
69 | } else {
|
70 | require('./bootstrap');
|
71 | }
|