Skip to content

Commit

Permalink
Use semver to check the Node version in the CLI
Browse files Browse the repository at this point in the history
Fixes #831.
  • Loading branch information
malept committed May 2, 2018
1 parent 2155cab commit 155631e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

'use strict'

var nodeVersionInfo = process.versions.node.split('.').map(function (n) { return Number(n) })
if (nodeVersionInfo < [4, 0, 0]) {
var semver = require('semver')
if (semver.lt(process.versions.node, '4.0.0')) {
console.error('CANNOT RUN WITH NODE ' + process.versions.node)
console.error('Electron Packager requires Node 4.0 or above.')
process.exit(1)
Expand Down

0 comments on commit 155631e

Please sign in to comment.