From 4b2f682a56333777ade154c0176e7567ad28a9cc Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Sun, 27 Feb 2022 22:29:37 -0600 Subject: [PATCH] Bump better-sqlite3 to 7.5 to fix "Could not detect abi" issue on Windows --- app/package.json | 2 +- scripts/postinstall.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/package.json b/app/package.json index ff0320cf03..68f59968ce 100644 --- a/app/package.json +++ b/app/package.json @@ -13,7 +13,7 @@ "dependencies": { "@bengotow/slate-edit-list": "github:bengotow/slate-edit-list#b868e108", "@electron/remote": "^2.0.1", - "better-sqlite3": "^7.1.2", + "better-sqlite3": "^7.5.0", "cheerio": "^1.0.0-rc.6", "chromium-net-errors": "1.0.3", "chrono-node": "^1.1.2", diff --git a/scripts/postinstall.js b/scripts/postinstall.js index 1efa6fa141..7bf5f2b4aa 100644 --- a/scripts/postinstall.js +++ b/scripts/postinstall.js @@ -145,11 +145,13 @@ async function run() { rimraf.sync(path.join(appModulesPath, 'better-sqlite3')); // install the module pointing to our local sqlite source with custom #DEFINEs set const amalgamationPath = path.join(appPath, 'build', 'sqlite-amalgamation'); + await npm('config set msvs_version 2019'); await npm( `install better-sqlite3@${appDependencies['better-sqlite3']} ` + `--no-save --no-audit --build-from-source --sqlite3="${amalgamationPath}"`, { cwd: './app', env: 'electron' } ); + await npm('config set msvs_version 2015'); // remove the build symlinks so that we can build an installer for the app without // symlinks out to the sqlite-amalgamation directory. rimraf.sync(path.join(appModulesPath, 'better-sqlite3', 'build', 'Release', 'obj'));