1
0
mirror of https://github.com/sasjs/adapter.git synced 2025-12-10 17:04:36 +00:00

chore: check node version before installing packages

This commit is contained in:
2021-08-23 13:42:37 +05:00
parent 4f62cd0148
commit 47ff1a2293
3 changed files with 2881 additions and 14587 deletions

21
checkNodeVersion.js Normal file
View File

@@ -0,0 +1,21 @@
const result = process.versions
if (result && result.node) {
if (parseInt(result.node) >= 14) {
console.log(
'\x1b[32m%s\x1b[0m',
`Good to Go with your Node Version: ${result.node}`
)
} else {
console.log(
'\x1b[31m%s\x1b[0m',
`Package installation(npm install) failed due to Node Version,\nPlease install and use Node Version >=14\nYour current Node Version is: ${result.node}`
)
process.exit(1)
}
} else {
console.log(
'\x1b[31m%s\x1b[0m',
'Something went wrong while checking Node version'
)
process.exit(1)
}