Skip to content

Commit

Permalink
fix(windows): download correct node.lib for arm64 arch on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jaycex committed Jan 22, 2024
1 parent b4b5b16 commit 90e116c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const environment = module.exports = {
isX86: os.arch() === "ia32" || os.arch() === "x86",
isX64: os.arch() === "x64",
isArm: os.arch() === "arm",
isArm64: os.arch() === "arm64",
runtime: "node",
runtimeVersion: process.versions.node,
home: process.env[(os.platform() === "win32") ? "USERPROFILE" : "HOME"],
Expand Down
2 changes: 1 addition & 1 deletion lib/runtimePaths.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const runtimePaths = {
return {
externalPath: ELECTRON_MIRROR + "/v" + targetOptions.runtimeVersion + "/",
winLibs: [{
dir: targetOptions.isX64 ? "x64" : "",
dir: targetOptions.isArm64 ? "arm64" : targetOptions.isX64 ? "x64" : "",
name: "node.lib"
}],
tarPath: "node" + "-v" + targetOptions.runtimeVersion + ".tar.gz",
Expand Down
5 changes: 5 additions & 0 deletions lib/targetOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ Object.defineProperties(TargetOptions.prototype, {
return this.arch === "arm";
}
},
isArm64: {
get: function () {
return this.arch === "arm64";
}
},
runtime: {
get: function () {
return this.options.runtime || environment.runtime;
Expand Down

0 comments on commit 90e116c

Please sign in to comment.