-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
32 lines (27 loc) · 878 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env node
/**
* cli app
*
* The source code is the main bin command of ``.
*/
// eslint-disable-next-line n/no-unsupported-features/es-syntax
import chalk from 'chalk';
const currentNodeVersion = process.versions.node;
const semver = currentNodeVersion.split('.');
const major = semver[0];
const minor = semver[1];
if (
major < 12 ||
(major === 12 && minor <= 20) ||
(major === 14 && minor <= 14)
) {
console.error(
chalk.red(`You are running Node ${currentNodeVersion}. \nThis package is now pure ESM, read ${chalk.blue(
'https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c'
)}. \nCreate Web App requires Node 12.20, 14.14 or higher. \nPlease update your version of Node.
`)
);
// eslint-disable-next-line n/no-process-exit
process.exit(1);
}
import('./src/cli/cli-app.js').catch((err) => console.error(err));