forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode-version-check.js
More file actions
32 lines (28 loc) · 941 Bytes
/
node-version-check.js
File metadata and controls
32 lines (28 loc) · 941 Bytes
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
// version-check
const version = process.version.split('.')
const major = parseInt(version[0].replace(/\D/g, ''), 10)
const minor = parseInt(version[1].replace(/\D/g,''), 10)
const patch = parseInt(version[2].replace(/\D/g,''), 10)
const min = {
major: 10,
minor: 0,
patch: 0
}
if (
major < min.major || (
major === min.major && (
minor < min.minor || (minor === min.minor && patch < min.patch)
)
)
) {
console.error()
console.error('--------------------------------------------------------')
console.error(' INCOMPATIBLE NODE VERSION')
console.error(` @quasar/icongenie requires Node ${min.major}.${min.minor}.${min.patch} or superior`)
console.error()
console.error(' You are running Node ' + process.version)
console.error(' Please install a compatible Node version and try again')
console.error('--------------------------------------------------------')
console.error()
process.exit(1)
}