From e04fa2f708ec2bcdd3154193846d6170e834491f Mon Sep 17 00:00:00 2001 From: Bartosz Antosik Date: Fri, 12 Jul 2024 14:33:19 +0200 Subject: [PATCH] Fix proposed by @reduckted --- lib/bindings.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/bindings.js b/lib/bindings.js index d31f738..4ce872a 100644 --- a/lib/bindings.js +++ b/lib/bindings.js @@ -15,14 +15,15 @@ var bindings = null; var Spellchecker = null; const loadBinary = function (baseName) { - const nodeFiles = glob.globSync(path.join(__dirname, `bin/${baseName}*${process.arch}*.node`)); - + const nodeFiles = glob.globSync(`bin/${baseName}*${process.arch}*.node`, { + cwd: __dirname, + }); var binding = null; nodeFiles.forEach((file) => { try { if (binding == null) { - binding = require(file); + binding = require(path.join(__dirname, file)); if (SPELLRIGHT_DEBUG_OUTPUT) { console.log('[spellright] Bindings: \"' + path.basename(file) + '\".'); }