Skip to content
This repository was archived by the owner on Mar 13, 2024. It is now read-only.

Commit c8fca5d

Browse files
committedJul 29, 2019
Fix node version check to match against package
Fixes #104
1 parent 01271e9 commit c8fca5d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎cli.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22

33
'use strict'
44

5-
if (process.version.match(/^v(\d+)\./)[1] < 6) {
6-
console.error('dependency-check: Node 6 or greater is required. `dependency-check` did not run.')
5+
const requiredNodeEngineMinimum = parseInt(require('./package.json').engines.node.match(/^>=(\d+)\./)[1], 10)
6+
const currentNodeEngine = parseInt(process.version.match(/^v(\d+)\./)[1], 10)
7+
8+
if (currentNodeEngine < requiredNodeEngineMinimum) {
9+
console.error('dependency-check: Node ' + requiredNodeEngineMinimum + ' or greater is required. `dependency-check` did not run.')
710
process.exit(0)
811
}
912

0 commit comments

Comments
 (0)
This repository has been archived.