From 501380ef6c7ab3585c853d148da545b8798e9ce5 Mon Sep 17 00:00:00 2001 From: Jakob Rosenberg Date: Wed, 6 Apr 2022 14:10:41 +0200 Subject: [PATCH] fix: npm couldn't install serialport at runtime --- lib/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/main.js b/lib/main.js index 2c0e699..a8325f9 100644 --- a/lib/main.js +++ b/lib/main.js @@ -14,7 +14,7 @@ export default { } catch (err) { if (err.code === 'MODULE_NOT_FOUND') { console.log('serialport not installed. Installing...'); - require('child_process').execSync('npm install serialport'); + require('child_process').execSync('npm install serialport', { cwd: __dirname + '/..' }); console.log('Installed serialport!'); } }