question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with rebuild, looks like a bug

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
maximilianMairingercommented, Jul 30, 2021

Any updates on this?

1reaction
AdrianoFerraricommented, May 27, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Linux project rebuild hangs Visual Studio
It looks like not a prodcut bug of Visual Studio, it is related with your project. Fortuntely , this issue has been resolved...
Read more >
Visual Studio Rebuilds unmodified projects - Stack Overflow
This issue is solved by changing the project files, cleaning solution, deleting all bin folders by hand, restarting Visual studio and rebuilding everything....
Read more >
Why Visual Studio keeps rebuilding my projects for no good ...
We have two different issues here: 1) VS rebuilds projects even though they haven't changed. 2) When something did change, VS tends to...
Read more >
Always rebuilding project in Visual Studio 2019, maybe found ...
Since switching to Visual Studio 2019 my projects always want to rebuild, and I think I found the problem. My files are on...
Read more >
636710 – revdep-rebuild in gentoolkit-0.4.0 causes infinite ...
The original revdep-rebuild script is installed as ... There is a bug here, but I'm having problems reproducing to track down the cause....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found