You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.6 KiB
47 lines
1.6 KiB
#!/usr/bin/env node
|
|
'use strict';
|
|
|
|
// Provide a title to the process in `ps`.
|
|
// Due to an obscure Mac bug, do not start this title with any symbol.
|
|
try {
|
|
process.title = 'ng ' + Array.from(process.argv).slice(2).join(' ');
|
|
} catch (_) {
|
|
// If an error happened above, use the most basic title.
|
|
process.title = 'ng';
|
|
}
|
|
|
|
// This node version check ensures that extremely old versions of node are not used.
|
|
// These may not support ES2015 features such as const/let/async/await/etc.
|
|
// These would then crash with a hard to diagnose error message.
|
|
// tslint:disable-next-line: no-var-keyword
|
|
var version = process.versions.node.split('.').map((part) => Number(part));
|
|
if (version[0] % 2 === 1 && version[0] > 14) {
|
|
// Allow new odd numbered releases with a warning (currently v15+)
|
|
console.warn(
|
|
'Node.js version ' +
|
|
process.version +
|
|
' detected.\n' +
|
|
'Odd numbered Node.js versions will not enter LTS status and should not be used for production.' +
|
|
' For more information, please see https://nodejs.org/en/about/releases/.',
|
|
);
|
|
|
|
require('../lib/init');
|
|
} else if (
|
|
version[0] < 12 ||
|
|
version[0] === 13 ||
|
|
(version[0] === 12 && version[1] < 14) ||
|
|
(version[0] === 14 && version[1] < 15)
|
|
) {
|
|
// Error and exit if less than 12.14 or 13.x or less than 14.15
|
|
console.error(
|
|
'Node.js version ' +
|
|
process.version +
|
|
' detected.\n' +
|
|
'The Angular CLI requires a minimum Node.js version of either v12.14 or v14.15.\n\n' +
|
|
'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n',
|
|
);
|
|
|
|
process.exitCode = 3;
|
|
} else {
|
|
require('../lib/init');
|
|
}
|