Do not run if node version older than 5.9
This commit is contained in:
Родитель
b7ad6e5364
Коммит
0cc8bb4a00
6
cli.js
6
cli.js
|
@ -21,6 +21,7 @@
|
|||
const meow = require('meow');
|
||||
const lighthouse = require('./');
|
||||
const log = require('npmlog');
|
||||
const semver = require('semver');
|
||||
const Printer = require('./cli/printer');
|
||||
const cli = meow(`
|
||||
Usage
|
||||
|
@ -38,6 +39,11 @@ const cli = meow(`
|
|||
const defaultUrl = 'https://m.flipkart.com';
|
||||
const url = cli.input[0] || defaultUrl;
|
||||
|
||||
if (semver.lt(process.version, '5.9.0')) {
|
||||
console.error('Lighthouse requires node version 5.9 or newer');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
lighthouse({
|
||||
url: url,
|
||||
flags: cli.flags
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
"devtools-timeline-model": "1.0.16",
|
||||
"meow": "^3.7.0",
|
||||
"npmlog": "^2.0.3",
|
||||
"semver": "^5.1.0",
|
||||
"traceviewer": "^1.0.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
Загрузка…
Ссылка в новой задаче