1 import { readFileSync
} from 'node:fs'
2 import { exit
, version
} from 'node:process'
4 import chalk
from 'chalk'
5 // eslint-disable-next-line n/no-unpublished-import
6 import { satisfies
} from 'semver'
8 const packageJson
= JSON
.parse(readFileSync('./package.json', 'utf8'))
11 * Check if the current node version match the required engines version.
13 export const checkNodeVersion
= () => {
14 const enginesNodeVersion
= packageJson
.engines
.node
15 if (satisfies(version
, enginesNodeVersion
) === false) {
18 `Required node version ${enginesNodeVersion} not satisfied with current version ${version}`
21 // eslint-disable-next-line n/no-process-exit