Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install sqlite3 #1748

Open
laozl opened this issue Jan 7, 2024 · 10 comments
Open

Unable to install sqlite3 #1748

laozl opened this issue Jan 7, 2024 · 10 comments

Comments

@laozl
Copy link

laozl commented Jan 7, 2024

Issue Summary

I am using the Win11 operating system and I want to integrate SQLITE3 into Electron, but it cannot be compiled and installed in node 18.18.2. Strangely, he will search for it link
However, this address does not exist

Relevant logs or output

• electron-builder version=24.9.1
• loaded configuration file=H:\Code\WebstormProjects\electron-app\electron-builder.yml
• rebuilding native dependencies dependencies=sqlite3@5.1.7 platform=win32 arch=x64
• install prebuilt binary name=sqlite3 version=5.1.7 platform=win32 arch=x64 napi=
• build native dependency from sources name=sqlite3
version=5.1.7
platform=win32
arch=x64
napi=
reason=prebuild-install failed with error (run with env DEBUG=electron-builder to get more information)
error=prebuild-install info begin Prebuild-install version 7.1.1
prebuild-install warn This package does not support N-API version 36
prebuild-install warn install prebuilt binaries enforced with --force!
prebuild-install warn install prebuilt binaries may be out of date!
prebuild-install info looking for local prebuild @ prebuilds\sqlite3-v5.1.7-napi-v36-win32-x64.tar.gz
prebuild-install info looking for cached prebuild @ C:\Users\Letudou\AppData\Roaming\npm-cache_prebuilds\9aa761-sqlite3-v5.1.7-napi-v36-win32-x64.tar.gz
prebuild-install http request GET https://github.com/TryGhost/node-sqlite3/releases/download/v5.1.7/sqlite3-v5.1.7-napi-v36-win32-x64.tar.gz
prebuild-install http 404 https://github.com/TryGhost/node-sqlite3/releases/download/v5.1.7/sqlite3-v5.1.7-napi-v36-win32-x64.tar.gz
prebuild-install warn install No prebuilt binaries found (target=36 runtime=napi arch=x64 libc= platform=win32)

• rebuilding native dependency name=sqlite3 version=5.1.7
⨯ cannot execute cause=exit status 1
$ prebuild-install -r napi || node-gyp rebuild
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

                errorOut=prebuild-install warn This package does not support N-API version 28.1.1
prebuild-install warn install No prebuilt binaries found (target=28.1.1 runtime=napi arch=x64 libc= platform=win32)
gyp info it worked if it ends with ok
gyp info using node-gyp@8.4.1
gyp info using node@18.18.2 | win32 | x64
gyp info find Python using Python version 3.10.9 found at "D:\Python\Python310\python.exe"
gyp info find VS using VS2022 (17.8.34330.188) found at:
gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Professional"
gyp info find VS run with --verbose for detailed information
gyp info spawn D:\Python\Python310\python.exe
gyp info spawn args [
gyp info spawn args   'H:\\Code\\WebstormProjects\\electron-app\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-I',
gyp info spawn args   'H:\\Code\\WebstormProjects\\electron-app\\node_modules\\sqlite3\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'H:\\Code\\WebstormProjects\\electron-app\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Letudou\\.electron-gyp\\28.1.1\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\Letudou\\.electron-gyp\\28.1.1',
gyp info spawn args   '-Dnode_gyp_dir=H:\\Code\\WebstormProjects\\electron-app\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\Letudou\\\\.electron-gyp\\\\28.1.1\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=H:\\Code\\WebstormProjects\\electron-app\\node_modules\\sqlite3',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'H:\\Code\\WebstormProjects\\electron-app\\node_modules\\sqlite3\\build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp: Active code page: 65001
..\node-addon-api\node_api.gyp not found (cwd: H:\Code\WebstormProjects\electron-app\node_modules\sqlite3) while loading dependencies of binding.gyp while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (H:\Code\WebstormProjects\electron-app\node_modules\node-gyp\lib\configure.js:259:16)
gyp ERR! stack     at ChildProcess.emit (node:events:517:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:292:12)
gyp ERR! System Windows_NT 10.0.22631
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "H:\\Code\\WebstormProjects\\electron-app\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd H:\Code\WebstormProjects\electron-app\node_modules\sqlite3
gyp ERR! node -v v18.18.2
gyp ERR! node-gyp -v v8.4.1
gyp ERR! not ok

error Command failed with exit code 1.

                command='C:\Program Files\nodejs\node.exe' 'D:\node\nvm\v18.18.2\node_modules\yarn\bin\yarn.js' run install
                workingDir=H:\Code\WebstormProjects\electron-app\node_modules\sqlite3

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Version

5.1.7

Node.js Version

18.18.2

How did you install the library?

yarn add sqlite3

@laozl
Copy link
Author

laozl commented Jan 7, 2024

But I'm going to modify the ` node_ In modules/sqlite3/package. json ',' binary ': {' napi_versions': [3,6]} 'is' binary': {'napi_versions': [6]}', which can be processed

@xieerduos
Copy link

I also encountered the same problem. Do you know how to solve it? thanks

@qyn980427
Copy link

I also encountered the same problem. Do you know how to solve it? thanks

#1746 I feel that the problem is the same as the problem I raised, and this solution proposed by this friend or manually downloaded to the local can be temporarily solved @laozl

@xieerduos
Copy link

xieerduos commented Jan 8, 2024

I also encountered the same problem. Do you know how to solve it? thanks

#1746 I feel that the problem is the same as the problem I raised, and this solution proposed by this friend or manually downloaded to the local can be temporarily solved @laozl

I've conducted tests and discovered that the issue began with version 5.1.7 of sqlite3. To temporarily resolve this, you can specify version 5.1.6 in your package.json file. Simply add or modify the sqlite3 dependency in the following manner:

"dependencies": {
    "sqlite3": "5.1.6"
}

This should bypass the issue until a permanent fix is implemented.

@laozl
Copy link
Author

laozl commented Jan 10, 2024

I also encountered the same problem. Do you know how to solve it? thanks

#1746 I feel that the problem is the same as the problem I raised, and this solution proposed by this friend or manually downloaded to the local can be temporarily solved @laozl

I've conducted tests and discovered that the issue began with version 5.1.7 of sqlite3. To temporarily resolve this, you can specify version 5.1.6 in your package.json file. Simply add or modify the sqlite3 dependency in the following manner:

"dependencies": {
    "sqlite3": "5.1.6"
}

This should bypass the issue until a permanent fix is implemented.

Thank you very much. Your plan has solved the troubles that have troubled me for a few days at once

@andyImatest
Copy link

I'm having the same issue with v5.1.7:

prebuild-install info looking for local prebuild @ prebuilds\sqlite3-v5.1.7-napi-v36-win32-x64.tar.gz

which should be looking for sqlite3-v5.1.7-napi-v6-win32-x64.tar.gz

Will pin to version v5.1.6 for now, but would love to make use of the improved bundling!

@milux
Copy link

milux commented Jan 29, 2024

+1

michaelkamphausen added a commit to roaringroster/webapp that referenced this issue Feb 15, 2024
…e of a build error related to trying to use a non-existing N-APi version napi v36 (see TryGhost/node-sqlite3#1748 and TryGhost/node-sqlite3#1746)
@faribauc
Copy link

faribauc commented Mar 12, 2024

+1 with sqlite3 5.1.7

Confirmed it works when locking 5.1.6

@webdevepru
Copy link

it doesn't work for me since
"sqlite3": "5.1.6",
"electron": "^28.2.1",
"electron-builder": "^24.13.3",

@jesusrogliero
Copy link

jesusrogliero commented May 5, 2024

"sqlite3": "5.1.6"

It worked for me, thank you very much.
Funciono para mi, Muchas gracias

"devDependencies": {
	"electron": "^13.4.0",
	"electron-builder": "^22.13.1",
	"eslint": "^7.32.0",
	"eslint-plugin-react": "^7.26.0"
},
"dependencies": {
	"@navpreetdevpuri/html-pdf": "^3.0.9",
	"appdata-path": "^1.0.0",
	"bcrypt": "5.1.0",
	"bcv-divisas": "^1.2.6",
	"electron-log": "^4.4.1",
	"electron-updater": "^6.1.1",
	"googleapis": "^123.0.0",
	"handlebars": "^4.7.8",
	"moment": "^2.29.4",
	"nodemailer": "^6.9.3",
	"sequelize": "^6.6.5",
	"sqlite3": "5.1.6"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants