Error when using the sqlite3 module in electronRunning source ~/.bashrc doesn't load the right version of...

Western buddy movie with a supernatural twist where a woman turns into an eagle at the end

Why is it a bad idea to hire a hitman to eliminate most corrupt politicians?

How to prevent "they're falling in love" trope

Where does SFDX store details about scratch orgs?

Why doesn't H₄O²⁺ exist?

Blender 2.8 I can't see vertices, edges or faces in edit mode

When a company launches a new product do they "come out" with a new product or do they "come up" with a new product?

What killed these X2 caps?

What's the point of deactivating Num Lock on login screens?

What mechanic is there to disable a threat instead of killing it?

How do conventional missiles fly?

Today is the Center

Fully-Firstable Anagram Sets

Why is the 'in' operator throwing an error with a string literal instead of logging false?

Alternative to sending password over mail?

Forgetting the musical notes while performing in concert

Watching something be written to a file live with tail

What do you call someone who asks many questions?

What exploit are these user agents trying to use?

Facing a paradox: Earnshaw's theorem in one dimension

Is it canonical bit space?

Has there ever been an airliner design involving reducing generator load by installing solar panels?

Why is consensus so controversial in Britain?

How do I write bicross product symbols in latex?



Error when using the sqlite3 module in electron


Running source ~/.bashrc doesn't load the right version of node when using nvm500 server error using IPython notebook on WindowsError when using create-react-app in node.js on Windows 7 64-bitWhere is the local node.js from the electron framework located?Repeatedly Getting “Cannot find module” errorHow to seamlessly multi target Electron debug with VSCode using the legacy protocol, electron 1.6.7 , node v6.11.1, vscode 1.17 and firefox?Error when installing ffmpeg-binaries using npmGetting errors while >> sudo npm install -g onoff in raspbian OSnpm install: “/usr/local/bin/g++-4.2: No such file or directory” with Xcode installedI am trying to install node.js but it keeps giving me an error when trying to install C++ x86






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















An error occurs when trying to use the NPM package sqlite3 in Electron. What can I do to get electron-builder to run? Or what can I do to use sqlite3 in electron ?



My development environment is windows 8.1 x64 node version v10.15.3 npm version 6.4.1.
My package.json file looks like this:
my package.json file



As an example the following project files:



index.js



const { app, BrowserWindow } = require('electron')
const sqlite3 = require("sqlite3")

function createWindow () {
// Create the browser window.
let win = new BrowserWindow({ width: 800, height: 600 })

// and load the index.html of the app.
win.loadFile('index.html')
}

app.on('ready', createWindow)


index.html



<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
We are using node <script>document.write(process.versions.node)</script>,
Chrome <script>document.write(process.versions.chrome)</script>,
and Electron <script>document.write(process.versions.electron)</script>.
</body>
</html>


After typing the command npm start into the cmd terminal, the following error message appears:
error after run electron



As a result, I found the following problem solution on the Internet:
How to use sqlite3 module with electron?



Then I made the above changes to my package.json file. After executing the command npm run postinstall in the terminal the following error message appears



λ npm run postinstall

> xxx@0.1.0 postinstall C:UsersxxxDesktopxxx
> electron-builder install-app-deps

Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
• electron-builder version=20.39.0
• rebuilding native production dependencies platform=win32 arch=x64
Error: C:Program Filesnodejsnode.exe exited with code 1
Output:

> sqlite3@4.0.6 install C:UsersxxxDesktopxxxnode_modulessqlite3
> node-pre-gyp install --fallback-to-build

Failed to execute 'C:Program Filesnodejsnode.exe C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gypbinnode-gyp.js configure --fallback-to-build --module=C:UsersxxxDesktopxxxnode_modulessqlite3libbindingelectron-v4.1-win32-x64node_sqlite3.node --module_name=node_sqlite3 --module_path=C:UsersxxxDesktopxxxnode_modulessqlite3libbindingelectron-v4.1-win32-x64 --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=electron-v4.1' (1)

Error output:
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.0.6/electron-v4.1-win32-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.0.6 and electron@4.1.3 (electron-v4.1 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gyplibconfigure.js:484:19)
gyp ERR! stack at PythonFinder.<anonymous> (C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gyplibconfigure.js:509:16)
gyp ERR! stack at C:Program Filesnodejsnode_modulesnpmnode_modulesgraceful-fspolyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:153:21)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\Users\xxx\Desktop\xxx\node_modules\sqlite3\lib\binding\electron-v4.1-win32-x64\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=C:\Users\xxx\Desktop\xxx\node_modules\sqlite3\lib\binding\electron-v4.1-win32-x64" "--napi_version=3" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=electron-v4.1"
gyp ERR! cwd C:UsersxxxDesktopxxxnode_modulessqlite3
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:Program Filesnodejsnode.exe C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gypbinnode-gyp.js configure --fallback-to-build --module=C:UsersxxxDesktopxxxnode_modulessqlite3libbindingelectron-v4.1-win32-x64node_sqlite3.node --module_name=node_sqlite3 --module_path=C:UsersxxxDesktopxxxnode_modulessqlite3libbindingelectron-v4.1-win32-x64 --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=electron-v4.1' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:UsersxxxDesktopxxxnode_modulesnode-pre-gyplibutilcompile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:189:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:970:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Windows_NT 6.3.9600
node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\xxx\Desktop\xxx\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:UsersxxxDesktopxxxnode_modulessqlite3
node-pre-gyp ERR! node -v v10.15.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.0.6 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sqlite3@4.0.6 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:UsersxxxAppDataRoamingnpm-cache_logs2019-04-04T17_19_09_963Z-debug.log

at ChildProcess.childProcess.once.code (C:UsersxxxDesktopxxxnode_modulesbuilder-utilsrcutil.ts:244:14)
at Object.onceWrapper (events.js:277:13)
at ChildProcess.emit (events.js:189:13)
at maybeClose (internal/child_process.js:970:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
From previous event:
at _rebuild (C:UsersxxxDesktopxxxnode_modulesapp-builder-libsrcutilyarn.ts:179:5)
at rebuild (C:UsersxxxDesktopxxxnode_modulesapp-builder-liboututilyarn.js:163:19)
at C:UsersxxxDesktopxxxnode_modulesapp-builder-libsrcutilyarn.ts:20:11
From previous event:
at _installOrRebuild (C:UsersxxxDesktopxxxnode_modulesapp-builder-liboututilyarn.js:71:28)
at installOrRebuild (C:UsersxxxDesktopxxxnode_modulesapp-builder-liboututilyarn.js:55:28)
at C:UsersxxxDesktopxxxnode_moduleselectron-buildersrccliinstall-app-deps.ts:56:9
at Generator.next (<anonymous>)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
From previous event:
at _installAppDeps (C:UsersxxxDesktopxxxnode_moduleselectron-builderoutcliinstall-app-deps.js:176:26)
at installAppDeps (C:UsersxxxDesktopxxxnode_moduleselectron-builderoutcliinstall-app-deps.js:144:26)
at then (C:UsersxxxDesktopxxxnode_moduleselectron-buildersrcclicli.ts:46:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! xxx@0.1.0 postinstall: `electron-builder install-app-deps`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the xxx@0.1.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:UsersxxxAppDataRoamingnpm-cache_logs2019-04-04T17_19_10_020Z-debug.log









share|improve this question







New contributor




jixaw is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



























    0















    An error occurs when trying to use the NPM package sqlite3 in Electron. What can I do to get electron-builder to run? Or what can I do to use sqlite3 in electron ?



    My development environment is windows 8.1 x64 node version v10.15.3 npm version 6.4.1.
    My package.json file looks like this:
    my package.json file



    As an example the following project files:



    index.js



    const { app, BrowserWindow } = require('electron')
    const sqlite3 = require("sqlite3")

    function createWindow () {
    // Create the browser window.
    let win = new BrowserWindow({ width: 800, height: 600 })

    // and load the index.html of the app.
    win.loadFile('index.html')
    }

    app.on('ready', createWindow)


    index.html



    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>Hello World!</title>
    </head>
    <body>
    <h1>Hello World!</h1>
    We are using node <script>document.write(process.versions.node)</script>,
    Chrome <script>document.write(process.versions.chrome)</script>,
    and Electron <script>document.write(process.versions.electron)</script>.
    </body>
    </html>


    After typing the command npm start into the cmd terminal, the following error message appears:
    error after run electron



    As a result, I found the following problem solution on the Internet:
    How to use sqlite3 module with electron?



    Then I made the above changes to my package.json file. After executing the command npm run postinstall in the terminal the following error message appears



    λ npm run postinstall

    > xxx@0.1.0 postinstall C:UsersxxxDesktopxxx
    > electron-builder install-app-deps

    Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
    Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
    • electron-builder version=20.39.0
    • rebuilding native production dependencies platform=win32 arch=x64
    Error: C:Program Filesnodejsnode.exe exited with code 1
    Output:

    > sqlite3@4.0.6 install C:UsersxxxDesktopxxxnode_modulessqlite3
    > node-pre-gyp install --fallback-to-build

    Failed to execute 'C:Program Filesnodejsnode.exe C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gypbinnode-gyp.js configure --fallback-to-build --module=C:UsersxxxDesktopxxxnode_modulessqlite3libbindingelectron-v4.1-win32-x64node_sqlite3.node --module_name=node_sqlite3 --module_path=C:UsersxxxDesktopxxxnode_modulessqlite3libbindingelectron-v4.1-win32-x64 --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=electron-v4.1' (1)

    Error output:
    node-pre-gyp WARN Using request for node-pre-gyp https download
    node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.0.6/electron-v4.1-win32-x64.tar.gz
    node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.0.6 and electron@4.1.3 (electron-v4.1 ABI, unknown) (falling back to source compile with node-gyp)
    gyp ERR! configure error
    gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
    gyp ERR! stack at PythonFinder.failNoPython (C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gyplibconfigure.js:484:19)
    gyp ERR! stack at PythonFinder.<anonymous> (C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gyplibconfigure.js:509:16)
    gyp ERR! stack at C:Program Filesnodejsnode_modulesnpmnode_modulesgraceful-fspolyfills.js:284:29
    gyp ERR! stack at FSReqWrap.oncomplete (fs.js:153:21)
    gyp ERR! System Windows_NT 6.3.9600
    gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\Users\xxx\Desktop\xxx\node_modules\sqlite3\lib\binding\electron-v4.1-win32-x64\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=C:\Users\xxx\Desktop\xxx\node_modules\sqlite3\lib\binding\electron-v4.1-win32-x64" "--napi_version=3" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=electron-v4.1"
    gyp ERR! cwd C:UsersxxxDesktopxxxnode_modulessqlite3
    gyp ERR! node -v v10.15.3
    gyp ERR! node-gyp -v v3.8.0
    gyp ERR! not ok
    node-pre-gyp ERR! build error
    node-pre-gyp ERR! stack Error: Failed to execute 'C:Program Filesnodejsnode.exe C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gypbinnode-gyp.js configure --fallback-to-build --module=C:UsersxxxDesktopxxxnode_modulessqlite3libbindingelectron-v4.1-win32-x64node_sqlite3.node --module_name=node_sqlite3 --module_path=C:UsersxxxDesktopxxxnode_modulessqlite3libbindingelectron-v4.1-win32-x64 --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=electron-v4.1' (1)
    node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:UsersxxxDesktopxxxnode_modulesnode-pre-gyplibutilcompile.js:83:29)
    node-pre-gyp ERR! stack at ChildProcess.emit (events.js:189:13)
    node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:970:16)
    node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
    node-pre-gyp ERR! System Windows_NT 6.3.9600
    node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\xxx\Desktop\xxx\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
    node-pre-gyp ERR! cwd C:UsersxxxDesktopxxxnode_modulessqlite3
    node-pre-gyp ERR! node -v v10.15.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.0.6 install: `node-pre-gyp install --fallback-to-build`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the sqlite3@4.0.6 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:UsersxxxAppDataRoamingnpm-cache_logs2019-04-04T17_19_09_963Z-debug.log

    at ChildProcess.childProcess.once.code (C:UsersxxxDesktopxxxnode_modulesbuilder-utilsrcutil.ts:244:14)
    at Object.onceWrapper (events.js:277:13)
    at ChildProcess.emit (events.js:189:13)
    at maybeClose (internal/child_process.js:970:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
    From previous event:
    at _rebuild (C:UsersxxxDesktopxxxnode_modulesapp-builder-libsrcutilyarn.ts:179:5)
    at rebuild (C:UsersxxxDesktopxxxnode_modulesapp-builder-liboututilyarn.js:163:19)
    at C:UsersxxxDesktopxxxnode_modulesapp-builder-libsrcutilyarn.ts:20:11
    From previous event:
    at _installOrRebuild (C:UsersxxxDesktopxxxnode_modulesapp-builder-liboututilyarn.js:71:28)
    at installOrRebuild (C:UsersxxxDesktopxxxnode_modulesapp-builder-liboututilyarn.js:55:28)
    at C:UsersxxxDesktopxxxnode_moduleselectron-buildersrccliinstall-app-deps.ts:56:9
    at Generator.next (<anonymous>)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
    From previous event:
    at _installAppDeps (C:UsersxxxDesktopxxxnode_moduleselectron-builderoutcliinstall-app-deps.js:176:26)
    at installAppDeps (C:UsersxxxDesktopxxxnode_moduleselectron-builderoutcliinstall-app-deps.js:144:26)
    at then (C:UsersxxxDesktopxxxnode_moduleselectron-buildersrcclicli.ts:46:19)
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! xxx@0.1.0 postinstall: `electron-builder install-app-deps`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the xxx@0.1.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:UsersxxxAppDataRoamingnpm-cache_logs2019-04-04T17_19_10_020Z-debug.log









    share|improve this question







    New contributor




    jixaw is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      An error occurs when trying to use the NPM package sqlite3 in Electron. What can I do to get electron-builder to run? Or what can I do to use sqlite3 in electron ?



      My development environment is windows 8.1 x64 node version v10.15.3 npm version 6.4.1.
      My package.json file looks like this:
      my package.json file



      As an example the following project files:



      index.js



      const { app, BrowserWindow } = require('electron')
      const sqlite3 = require("sqlite3")

      function createWindow () {
      // Create the browser window.
      let win = new BrowserWindow({ width: 800, height: 600 })

      // and load the index.html of the app.
      win.loadFile('index.html')
      }

      app.on('ready', createWindow)


      index.html



      <!DOCTYPE html>
      <html>
      <head>
      <meta charset="UTF-8">
      <title>Hello World!</title>
      </head>
      <body>
      <h1>Hello World!</h1>
      We are using node <script>document.write(process.versions.node)</script>,
      Chrome <script>document.write(process.versions.chrome)</script>,
      and Electron <script>document.write(process.versions.electron)</script>.
      </body>
      </html>


      After typing the command npm start into the cmd terminal, the following error message appears:
      error after run electron



      As a result, I found the following problem solution on the Internet:
      How to use sqlite3 module with electron?



      Then I made the above changes to my package.json file. After executing the command npm run postinstall in the terminal the following error message appears



      λ npm run postinstall

      > xxx@0.1.0 postinstall C:UsersxxxDesktopxxx
      > electron-builder install-app-deps

      Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
      Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
      • electron-builder version=20.39.0
      • rebuilding native production dependencies platform=win32 arch=x64
      Error: C:Program Filesnodejsnode.exe exited with code 1
      Output:

      > sqlite3@4.0.6 install C:UsersxxxDesktopxxxnode_modulessqlite3
      > node-pre-gyp install --fallback-to-build

      Failed to execute 'C:Program Filesnodejsnode.exe C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gypbinnode-gyp.js configure --fallback-to-build --module=C:UsersxxxDesktopxxxnode_modulessqlite3libbindingelectron-v4.1-win32-x64node_sqlite3.node --module_name=node_sqlite3 --module_path=C:UsersxxxDesktopxxxnode_modulessqlite3libbindingelectron-v4.1-win32-x64 --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=electron-v4.1' (1)

      Error output:
      node-pre-gyp WARN Using request for node-pre-gyp https download
      node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.0.6/electron-v4.1-win32-x64.tar.gz
      node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.0.6 and electron@4.1.3 (electron-v4.1 ABI, unknown) (falling back to source compile with node-gyp)
      gyp ERR! configure error
      gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
      gyp ERR! stack at PythonFinder.failNoPython (C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gyplibconfigure.js:484:19)
      gyp ERR! stack at PythonFinder.<anonymous> (C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gyplibconfigure.js:509:16)
      gyp ERR! stack at C:Program Filesnodejsnode_modulesnpmnode_modulesgraceful-fspolyfills.js:284:29
      gyp ERR! stack at FSReqWrap.oncomplete (fs.js:153:21)
      gyp ERR! System Windows_NT 6.3.9600
      gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\Users\xxx\Desktop\xxx\node_modules\sqlite3\lib\binding\electron-v4.1-win32-x64\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=C:\Users\xxx\Desktop\xxx\node_modules\sqlite3\lib\binding\electron-v4.1-win32-x64" "--napi_version=3" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=electron-v4.1"
      gyp ERR! cwd C:UsersxxxDesktopxxxnode_modulessqlite3
      gyp ERR! node -v v10.15.3
      gyp ERR! node-gyp -v v3.8.0
      gyp ERR! not ok
      node-pre-gyp ERR! build error
      node-pre-gyp ERR! stack Error: Failed to execute 'C:Program Filesnodejsnode.exe C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gypbinnode-gyp.js configure --fallback-to-build --module=C:UsersxxxDesktopxxxnode_modulessqlite3libbindingelectron-v4.1-win32-x64node_sqlite3.node --module_name=node_sqlite3 --module_path=C:UsersxxxDesktopxxxnode_modulessqlite3libbindingelectron-v4.1-win32-x64 --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=electron-v4.1' (1)
      node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:UsersxxxDesktopxxxnode_modulesnode-pre-gyplibutilcompile.js:83:29)
      node-pre-gyp ERR! stack at ChildProcess.emit (events.js:189:13)
      node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:970:16)
      node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
      node-pre-gyp ERR! System Windows_NT 6.3.9600
      node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\xxx\Desktop\xxx\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
      node-pre-gyp ERR! cwd C:UsersxxxDesktopxxxnode_modulessqlite3
      node-pre-gyp ERR! node -v v10.15.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.0.6 install: `node-pre-gyp install --fallback-to-build`
      npm ERR! Exit status 1
      npm ERR!
      npm ERR! Failed at the sqlite3@4.0.6 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:UsersxxxAppDataRoamingnpm-cache_logs2019-04-04T17_19_09_963Z-debug.log

      at ChildProcess.childProcess.once.code (C:UsersxxxDesktopxxxnode_modulesbuilder-utilsrcutil.ts:244:14)
      at Object.onceWrapper (events.js:277:13)
      at ChildProcess.emit (events.js:189:13)
      at maybeClose (internal/child_process.js:970:16)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
      From previous event:
      at _rebuild (C:UsersxxxDesktopxxxnode_modulesapp-builder-libsrcutilyarn.ts:179:5)
      at rebuild (C:UsersxxxDesktopxxxnode_modulesapp-builder-liboututilyarn.js:163:19)
      at C:UsersxxxDesktopxxxnode_modulesapp-builder-libsrcutilyarn.ts:20:11
      From previous event:
      at _installOrRebuild (C:UsersxxxDesktopxxxnode_modulesapp-builder-liboututilyarn.js:71:28)
      at installOrRebuild (C:UsersxxxDesktopxxxnode_modulesapp-builder-liboututilyarn.js:55:28)
      at C:UsersxxxDesktopxxxnode_moduleselectron-buildersrccliinstall-app-deps.ts:56:9
      at Generator.next (<anonymous>)
      at runCallback (timers.js:705:18)
      at tryOnImmediate (timers.js:676:5)
      at processImmediate (timers.js:658:5)
      From previous event:
      at _installAppDeps (C:UsersxxxDesktopxxxnode_moduleselectron-builderoutcliinstall-app-deps.js:176:26)
      at installAppDeps (C:UsersxxxDesktopxxxnode_moduleselectron-builderoutcliinstall-app-deps.js:144:26)
      at then (C:UsersxxxDesktopxxxnode_moduleselectron-buildersrcclicli.ts:46:19)
      npm ERR! code ELIFECYCLE
      npm ERR! errno 1
      npm ERR! xxx@0.1.0 postinstall: `electron-builder install-app-deps`
      npm ERR! Exit status 1
      npm ERR!
      npm ERR! Failed at the xxx@0.1.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:UsersxxxAppDataRoamingnpm-cache_logs2019-04-04T17_19_10_020Z-debug.log









      share|improve this question







      New contributor




      jixaw is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      An error occurs when trying to use the NPM package sqlite3 in Electron. What can I do to get electron-builder to run? Or what can I do to use sqlite3 in electron ?



      My development environment is windows 8.1 x64 node version v10.15.3 npm version 6.4.1.
      My package.json file looks like this:
      my package.json file



      As an example the following project files:



      index.js



      const { app, BrowserWindow } = require('electron')
      const sqlite3 = require("sqlite3")

      function createWindow () {
      // Create the browser window.
      let win = new BrowserWindow({ width: 800, height: 600 })

      // and load the index.html of the app.
      win.loadFile('index.html')
      }

      app.on('ready', createWindow)


      index.html



      <!DOCTYPE html>
      <html>
      <head>
      <meta charset="UTF-8">
      <title>Hello World!</title>
      </head>
      <body>
      <h1>Hello World!</h1>
      We are using node <script>document.write(process.versions.node)</script>,
      Chrome <script>document.write(process.versions.chrome)</script>,
      and Electron <script>document.write(process.versions.electron)</script>.
      </body>
      </html>


      After typing the command npm start into the cmd terminal, the following error message appears:
      error after run electron



      As a result, I found the following problem solution on the Internet:
      How to use sqlite3 module with electron?



      Then I made the above changes to my package.json file. After executing the command npm run postinstall in the terminal the following error message appears



      λ npm run postinstall

      > xxx@0.1.0 postinstall C:UsersxxxDesktopxxx
      > electron-builder install-app-deps

      Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
      Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
      • electron-builder version=20.39.0
      • rebuilding native production dependencies platform=win32 arch=x64
      Error: C:Program Filesnodejsnode.exe exited with code 1
      Output:

      > sqlite3@4.0.6 install C:UsersxxxDesktopxxxnode_modulessqlite3
      > node-pre-gyp install --fallback-to-build

      Failed to execute 'C:Program Filesnodejsnode.exe C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gypbinnode-gyp.js configure --fallback-to-build --module=C:UsersxxxDesktopxxxnode_modulessqlite3libbindingelectron-v4.1-win32-x64node_sqlite3.node --module_name=node_sqlite3 --module_path=C:UsersxxxDesktopxxxnode_modulessqlite3libbindingelectron-v4.1-win32-x64 --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=electron-v4.1' (1)

      Error output:
      node-pre-gyp WARN Using request for node-pre-gyp https download
      node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.0.6/electron-v4.1-win32-x64.tar.gz
      node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.0.6 and electron@4.1.3 (electron-v4.1 ABI, unknown) (falling back to source compile with node-gyp)
      gyp ERR! configure error
      gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
      gyp ERR! stack at PythonFinder.failNoPython (C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gyplibconfigure.js:484:19)
      gyp ERR! stack at PythonFinder.<anonymous> (C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gyplibconfigure.js:509:16)
      gyp ERR! stack at C:Program Filesnodejsnode_modulesnpmnode_modulesgraceful-fspolyfills.js:284:29
      gyp ERR! stack at FSReqWrap.oncomplete (fs.js:153:21)
      gyp ERR! System Windows_NT 6.3.9600
      gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\Users\xxx\Desktop\xxx\node_modules\sqlite3\lib\binding\electron-v4.1-win32-x64\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=C:\Users\xxx\Desktop\xxx\node_modules\sqlite3\lib\binding\electron-v4.1-win32-x64" "--napi_version=3" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=electron-v4.1"
      gyp ERR! cwd C:UsersxxxDesktopxxxnode_modulessqlite3
      gyp ERR! node -v v10.15.3
      gyp ERR! node-gyp -v v3.8.0
      gyp ERR! not ok
      node-pre-gyp ERR! build error
      node-pre-gyp ERR! stack Error: Failed to execute 'C:Program Filesnodejsnode.exe C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gypbinnode-gyp.js configure --fallback-to-build --module=C:UsersxxxDesktopxxxnode_modulessqlite3libbindingelectron-v4.1-win32-x64node_sqlite3.node --module_name=node_sqlite3 --module_path=C:UsersxxxDesktopxxxnode_modulessqlite3libbindingelectron-v4.1-win32-x64 --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=electron-v4.1' (1)
      node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:UsersxxxDesktopxxxnode_modulesnode-pre-gyplibutilcompile.js:83:29)
      node-pre-gyp ERR! stack at ChildProcess.emit (events.js:189:13)
      node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:970:16)
      node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
      node-pre-gyp ERR! System Windows_NT 6.3.9600
      node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\xxx\Desktop\xxx\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
      node-pre-gyp ERR! cwd C:UsersxxxDesktopxxxnode_modulessqlite3
      node-pre-gyp ERR! node -v v10.15.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.0.6 install: `node-pre-gyp install --fallback-to-build`
      npm ERR! Exit status 1
      npm ERR!
      npm ERR! Failed at the sqlite3@4.0.6 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:UsersxxxAppDataRoamingnpm-cache_logs2019-04-04T17_19_09_963Z-debug.log

      at ChildProcess.childProcess.once.code (C:UsersxxxDesktopxxxnode_modulesbuilder-utilsrcutil.ts:244:14)
      at Object.onceWrapper (events.js:277:13)
      at ChildProcess.emit (events.js:189:13)
      at maybeClose (internal/child_process.js:970:16)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
      From previous event:
      at _rebuild (C:UsersxxxDesktopxxxnode_modulesapp-builder-libsrcutilyarn.ts:179:5)
      at rebuild (C:UsersxxxDesktopxxxnode_modulesapp-builder-liboututilyarn.js:163:19)
      at C:UsersxxxDesktopxxxnode_modulesapp-builder-libsrcutilyarn.ts:20:11
      From previous event:
      at _installOrRebuild (C:UsersxxxDesktopxxxnode_modulesapp-builder-liboututilyarn.js:71:28)
      at installOrRebuild (C:UsersxxxDesktopxxxnode_modulesapp-builder-liboututilyarn.js:55:28)
      at C:UsersxxxDesktopxxxnode_moduleselectron-buildersrccliinstall-app-deps.ts:56:9
      at Generator.next (<anonymous>)
      at runCallback (timers.js:705:18)
      at tryOnImmediate (timers.js:676:5)
      at processImmediate (timers.js:658:5)
      From previous event:
      at _installAppDeps (C:UsersxxxDesktopxxxnode_moduleselectron-builderoutcliinstall-app-deps.js:176:26)
      at installAppDeps (C:UsersxxxDesktopxxxnode_moduleselectron-builderoutcliinstall-app-deps.js:144:26)
      at then (C:UsersxxxDesktopxxxnode_moduleselectron-buildersrcclicli.ts:46:19)
      npm ERR! code ELIFECYCLE
      npm ERR! errno 1
      npm ERR! xxx@0.1.0 postinstall: `electron-builder install-app-deps`
      npm ERR! Exit status 1
      npm ERR!
      npm ERR! Failed at the xxx@0.1.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:UsersxxxAppDataRoamingnpm-cache_logs2019-04-04T17_19_10_020Z-debug.log






      node.js






      share|improve this question







      New contributor




      jixaw is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      jixaw is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      jixaw is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 11 hours ago









      jixawjixaw

      1




      1




      New contributor




      jixaw is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      jixaw is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      jixaw is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          jixaw is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1421525%2ferror-when-using-the-sqlite3-module-in-electron%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          jixaw is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          jixaw is a new contributor. Be nice, and check out our Code of Conduct.













          jixaw is a new contributor. Be nice, and check out our Code of Conduct.












          jixaw is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1421525%2ferror-when-using-the-sqlite3-module-in-electron%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

          Tribunal Administrativo e Fiscal de Mirandela Referências Menu de...

          looking for continuous Screen Capture for retroactivly reproducing errors, timeback machineRolling desktop...