Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#831 Update node version check to support node 10 #832

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions cli.js
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 nodeMajorVersion = Number(process.versions.node.split('.')[0])
if (nodeMajorVersion < 4) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to check if the version is greater than some specific semver in the future, I would require semver and use its comparison method... inequality checks on arrays convert to strings ... so [4,2,0] > [4,10,0] == true but should be false when comparing two versions.

But, if all this cares about is the major version, then this approach is sufficient.

console.error('CANNOT RUN WITH NODE ' + process.versions.node)
console.error('Electron Packager requires Node 4.0 or above.')
process.exit(1)
Expand Down