-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Fail to run on NodeJS 10. It says "Node 4.0 or above" #863
Comments
👋 Thanks for opening your first issue here! If you have a question about using Electron Packager, read the support docs. If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. Development and issue triage is community-driven, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines. |
Just now I made analysis of existing code, and I have found that next thing (copied from var curVer = [4, 0, 0];
var nodeVersionInfo = process.versions.node.split('.').map(function (n) { return Number(n) })
if (nodeVersionInfo < curVer) {
console.error(nodeVersionInfo + " is smaller than " + curVer);
} else {
console.error(nodeVersionInfo + " is greater than " + curVer);
} it prints me next:
So, it's needed a totally different check of this, it's wrong logic as I see. As temporary workaround for me, I have commented this wrong check, and electron-packager work fine now. For correctness, I'll try to write better and more accurate version check for this... |
Okay, I have made the better check which is completely resolves this issue: var curVer = [4, 0, 0];
function versionOlder(current, needed)
{
for(var i = 0; i < current.length && i < needed.length; i++)
{
if(current[i] == needed[i])
continue;
return current[i] < needed[i];
}
return false;
}
var nodeVersionInfo = process.versions.node.split('.').map(function (n) { return Number(n) })
if (versionOlder(nodeVersionInfo, curVer)) {
console.error(nodeVersionInfo + " is smaller than " + curVer);
} else {
console.error(nodeVersionInfo + " is greater than " + curVer);
} And output now
|
And the final code: function versionOlder(current, needed) {
for (var i = 0; i < current.length && i < needed.length; i++) {
if (current[i] == needed[i])
continue;
return current[i] < needed[i];
}
return false;
}
var nodeVersionInfo = process.versions.node.split('.').map(function (n) { return Number(n) });
if (versionOlder(nodeVersionInfo, [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)
} |
Okay, just now I checked your |
For completeness, this was fixed in version 12.0.2. (Electron Packager does not come with NPM.) |
, closes #87 Pull nodejs-10 fix from Teteros: Simple version bump because electron-packager fails to run on Node 10+ electron/packager#863 * update-electron-packager: EBEAST: Update electron-packager Signed-off-by: Tim Janik <timj@gnu.org>
This comment has been minimized.
This comment has been minimized.
try to change "electron-packager": to "^12.1.0" in package,json and run gradle info build.. so that you can see exact issue |
Please describe your issue:
Console output when you run electron-packager with the environment variable
DEBUG=electron-packager
. Please include the stack trace if one exists.What command line arguments are you passing? Alternatively, if you are using the API, what
parameters are you passing to the
packager()
function?Please provide either a failing minimal testcase (with a link to the code) or detailed steps to
reproduce your problem. Using electron-quick-start
is a good starting point.
I have NodeJS 10.5 installed and I have tried to use yarn build thing to compile some application, however, electron-packager fails. It thinks "10.5" is OLDER than 4.0. What the heck? 🤣
The text was updated successfully, but these errors were encountered: