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.
CANNOT RUN WITH NODE 10.5.0
Electron Packager requires Node 4.0 or above.
What command line arguments are you passing? Alternatively, if you are using the API, what
parameters are you passing to the packager() function?
electron-packager ./app "xxxxx" --out=dist --package-manager=yarn --platform=win32 --arch=x64 --electron-version=1.7.8 --icon=assets/win/xxxxx.ico
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? :rofl:
馃憢 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 cli.js):
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:
$ node check.js
10,5,0 is smaller than 4,0,0
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
$ node check.js
10,5,0 is greater than 4,0,0
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 master branch, and I see you have already fixed it by using semver thing. Version of electron packager at me is 8.7.2 came with npm installation. So, everything must be fine. Sorry for disturbing.
For completeness, this was fixed in version 12.0.2. _(Electron Packager does not come with NPM.)_
You could also update your electron package to 3.0.8 and electron package manager to 12.1.0.
try to change "electron-packager": to "^12.1.0" in package,json
and run gradle info build.. so that you can see exact issue
Most helpful comment
try to change "electron-packager": to "^12.1.0" in package,json
and run gradle info build.. so that you can see exact issue