Issue with rebuild, looks like a bug
See original GitHub issueI cant get SQLite to rebuild under Electron, and it has been suggested on the SQLite forum that it is an Electron bug. Here is the reply I got on the issue…
As Stephan says, this is a problem with the Electron scripts, not with SQLite. Specifically, from the error near the top of the log:
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. unpack_sqlite_dep 'C:\Users\Ion' is not recognized as an internal or external command, operable program or batch file.
when your “users” directory is C:\Users\Ion Hatzithomas one can see that the script isn’t coping with spaces in the installation path, and should be brought up with whoever packages Electron.
If you are able to choose a different installation directory (one without spaces), that might work in the interim. Another possibility would be to create a new Windows user without a space in it (e.g. C:\Users\IonH) and try things logged-in as that user.
Here is what I am doing to produce the issue and the output error…
Install Node… node-v12.16.3-x64 During install of Node, I do check the box that says “Automatically install the necessary tools”
Next I create a fresh new folder for my Electron project
Then I run… npm init -y npm install --save electron npm install --save sqlite3 npm install --save-dev electron-builder
All of which complete without errors.
Then I add to my package.json under scripts… “postinstall”: “electron-builder install-app-deps”
Then I run… npm run postinstall which causes the error: Please let me know if there is something I can do as a work around or if there will be a fix.
CMPDB@1.0.0 postinstall D:\dropbox\CMPDB
electron-builder install-app-deps
• electron-builder version=22.6.1
• rebuilding native dependencies dependencies=sqlite3@4.2.0 platform=win32 arch=x64
⨯ cannot execute cause=exit status 1
out=
sqlite3@4.2.0 install D:\dropbox\CMPDB\node_modules\sqlite3
node-pre-gyp install --fallback-to-build
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
unpack_sqlite_dep
'C:\Users\Ion' is not recognized as an internal or external command,
operable program or batch file.
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(209,5): error MSB6006: "cmd.exe" exited with code 1. [D:\dropbox\CMPDB\node_modules\sqlite3\build\deps\action_before_build.vcxproj]
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Ion Hatzithomas\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=D:\dropbox\CMPDB\node_modules\sqlite3\lib\binding\electron-v9.0-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=D:\dropbox\CMPDB\node_modules\sqlite3\lib\binding\electron-v9.0-win32-x64 --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=electron-v9.0' (1)
errorOut=node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/electron-v9.0-win32-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.2.0 and electron@9.0.0 (electron-v9.0 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\Ion Hatzithomas\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:310:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Ion Hatzithomas\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=D:\\dropbox\\CMPDB\\node_modules\\sqlite3\\lib\\binding\\electron-v9.0-win32-x64\\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=D:\\dropbox\\CMPDB\\node_modules\\sqlite3\\lib\\binding\\electron-v9.0-win32-x64" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=electron-v9.0"
gyp ERR! cwd D:\dropbox\CMPDB\node_modules\sqlite3
gyp ERR! node -v v12.16.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Ion Hatzithomas\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=D:\dropbox\CMPDB\node_modules\sqlite3\lib\binding\electron-v9.0-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=D:\dropbox\CMPDB\node_modules\sqlite3\lib\binding\electron-v9.0-win32-x64 --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=electron-v9.0' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (D:\Dropbox\CMPDB\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:310:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
node-pre-gyp ERR! System Windows_NT 10.0.18362
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\Dropbox\\CMPDB\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd D:\dropbox\CMPDB\node_modules\sqlite3
node-pre-gyp ERR! node -v v12.16.3
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sqlite3@4.2.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sqlite3@4.2.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Ion Hatzithomas\AppData\Roaming\npm-cache\_logs\2020-05-25T01_12_42_765Z-debug.log
command='C:\Program Files\nodejs\node.exe' 'C:\Users\Ion Hatzithomas\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js' rebuild sqlite3@4.2.0
workingDir=
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! CMPDB@1.0.0 postinstall: `electron-builder install-app-deps`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the CMPDB@1.0.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Ion Hatzithomas\AppData\Roaming\npm-cache\_logs\2020-05-25T01_12_42_818Z-debug.log
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top GitHub Comments
Any updates on this?
Oh ok, I think I see. It can’t find prebuilt binaries for electron 9.0.0 OR sqlite3, but it’s the sqlite that’s the problem here because it errors out when building that from source.
So yes, ignore what I said about
node-abi@latest
.