Open qyn980427 opened 10 months ago
The electron version is 27.1.0
Mee too. But the electron version is 9.3.3.
My electron app build also starts complaining.
Run prePackHook (_build-hooks/prePack.js)
• rebuilding native dependencies dependencies=sqlite3@5.1.7 platform=darwin arch=arm64
• install prebuilt binary name=sqlite3 version=5.1.7 platform=darwin arch=arm64 napi=
[[33m • build native dependency from sources name=sqlite3
version=5.1.7
platform=darwin
arch=arm64
napi=
[[33mreason=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-darwin-arm64.tar.gz
prebuild-install info looking for cached prebuild @ /Users/bernhard/.npm/_prebuilds/c10e52-sqlite3-v5.1.7-napi-v36-darwin-arm64.tar.gz
prebuild-install http request GET https://github.com/TryGhost/node-sqlite3/releases/download/v5.1.7/sqlite3-v5.1.7-napi-v36-darwin-arm64.tar.gz
prebuild-install http 404 https://github.com/TryGhost/node-sqlite3/releases/download/v5.1.7/sqlite3-v5.1.7-napi-v36-darwin-arm64.tar.gz
prebuild-install warn install No prebuilt binaries found (target=36 runtime=napi arch=arm64 libc= platform=darwin)
same here. I have temp workaround pnpm --prefix=node_modules/sqlite3 run rebuild
or also works for me
(cd $(dirname $(node -p 'require.resolve(
sqlite3/package.json)')) && pnpx prebuild-install -r napi --verbose)
or
(cd $(dirname $(node -p 'require.resolve(
sqlite3/package.json)')) && npx prebuild-install -r napi --verbose)
My electron app build also starts complaining.
Run prePackHook (_build-hooks/prePack.js) • rebuilding native dependencies dependencies=sqlite3@5.1.7 platform=darwin arch=arm64 • install prebuilt binary name=sqlite3 version=5.1.7 platform=darwin arch=arm64 napi= [[33m • build native dependency from sources name=sqlite3 version=5.1.7 platform=darwin arch=arm64 napi= [[33mreason=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-darwin-arm64.tar.gz prebuild-install info looking for cached prebuild @ /Users/bernhard/.npm/_prebuilds/c10e52-sqlite3-v5.1.7-napi-v36-darwin-arm64.tar.gz prebuild-install http request GET https://github.com/TryGhost/node-sqlite3/releases/download/v5.1.7/sqlite3-v5.1.7-napi-v36-darwin-arm64.tar.gz prebuild-install http 404 https://github.com/TryGhost/node-sqlite3/releases/download/v5.1.7/sqlite3-v5.1.7-napi-v36-darwin-arm64.tar.gz prebuild-install warn install No prebuilt binaries found (target=36 runtime=napi arch=arm64 libc= platform=darwin)
however that sounds like thing related to cache. When removed the cache it has been rebuild and more ore less started working (can't check with @electron/rebuild now but i guess it may work now) https://github.com/prebuild/prebuild-install/blob/master/README.md#cache
I also noticed that node 18 has napi 9 so the requested target v36 might be a clue of the issue
ELECTRON_RUN_AS_NODE=1 electron -p process.versions.napi
> 9
the issue seems to be with one of legacy dependencies of electron-builder. I reported a bug there
me too!How did you solve it
@liyang9331 Workaround: use 5.1.6 instead of 5.1.7 https://github.com/TryGhost/node-sqlite3/issues/1748#issuecomment-1880671655
prebuild-install http request GET https://github.com/TryGhost/node-sqlite3/releases/download/v5.1.7/sqlite3-v5.1.7-napi-v36-darwin-arm64.tar.gz prebuild-install warn install Request timed out
why it is sqlite3-v5.1.7-napi-v36-darwin-arm64.tar.gz, it is 404, why do it down sqlite3-v5.1.7-napi-v36-darwin-arm64.tar.gz?
I ran into the same issue trying to install 5.1.7. Installing 5.1.6 instead works builds with no issue.
npm install -E sqlite3@5.1.6
Running node v20.9.0 on my win 10 system, building with electron v28.1.4 and electron-builder v24.9.1
section of the output with env var "DEBUG=electron-builder"
• install prebuilt binary name=sqlite3 version=5.1.7 platform=win32 arch=x64 napi=
• execute command command='C:\Program Files\nodejs\node.exe' 'C:\Data\ZENDev\multisigappV1\node_modules\prebuild-install\bin.js' --platform=win32 --arch=x64 --target=36 --runtime=napi --verbose --force
workingDirectory=C:\Data\ZENDev\multisigappV1\node_modules\sqlite3
• 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 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)
I ran into the same issue trying to install 5.1.7. Installing 5.1.6 instead works builds with no issue.
npm install -E sqlite3@5.1.6
Running node v20.9.0 on my win 10 system, building with electron v28.1.4 and electron-builder v24.9.1
section of the output with env var "DEBUG=electron-builder"
• install prebuilt binary name=sqlite3 version=5.1.7 platform=win32 arch=x64 napi= • execute command command='C:\Program Files\nodejs\node.exe' 'C:\Data\ZENDev\multisigappV1\node_modules\prebuild-install\bin.js' --platform=win32 --arch=x64 --target=36 --runtime=napi --verbose --force workingDirectory=C:\Data\ZENDev\multisigappV1\node_modules\sqlite3 • 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 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)
Same here, this worked for me
I also encountered the same problem, why is the N-API version 36 instead of the specific version?
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 @ E:\other\nodejs\node_cache\_prebuilds\6626a9-sqlite3-v5.1.7-napi-v36-win32-x64.tar.gz
prebuild-install http request GET https://npmmirror.com/mirrors/sqlite3//v5.1.7/sqlite3-v5.1.7-napi-v36-win32-x64.tar.gz
prebuild-install http 404 https://npmmirror.com/mirrors/sqlite3//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)
I have the same issue.
npm install -E sqlite3@5.1.6
This really solves for me. Thanks. @ADumaine
@draungminoo Thank you so much
@draungminoo Thank you~!
me too.revert to 5.1.6 is ok.
我有一个不降低版本的做法:
在这里下载版本https://github.com/TryGhost/node-sqlite3/releases(我这里我下载的是sqlite3-v5.1.7-napi-v6-win32-x64.tar.gz)。
修改文件名称:sqlite3-v5.1.7-napi-v6-win32-x64.tar.gz
改为 sqlite3-v5.1.7-napi-v36-win32-x64.tar.gz
。
注意:我的系统是
Windows x64
,我下载也是对应版本。
在你的项目里创建prebuilds
目录(当然也可以是其他任何地方)。
在你的项目里创建.npmrc
文件,文件内容如下:
# Set Prebuilds Path
sqlite3_local_prebuilds=E:/electron-vite-vue/prebuilds
最后一步,将刚才下载的文件移动至prebuilds
目录下, 文件目录结构如下
E:\electron-vite-vue\prebuilds\sqlite3-v5.1.7-napi-v36-win32-x64.tar.gz
开始构建项目吧!pnpm build
same here. I guess something is wrong with version detecting logic, it is supposed to return 3 or 6, not 36
I revert to 5.1.6 got below error, anyone with me?
Uncaught Exception:
Error: Cannot find module 'mock-aws-s3'
Require stack:
- /Users/wenjoy/workspace/studio/order-system/out/order-system-darwin-arm64/order-system.app/Contents/Resources/app.asar/.vite/build/main.js
-
at Module._resolveFilename (node:internal/modules/cjs/loader:1055:15)
at s._resolveFilename (node:electron/js2c/browser_init:2:115476)
at Module._load (node:internal/modules/cjs/loader:908:27)
at c._load (node:electron/js2c/node_init:2:13672)
at Module.require (node:internal/modules/cjs/loader:1122:19)
at require (node:internal/modules/helpers:130:18)
at Object.<anonymous> (/Users/wenjoy/workspace/studio/order-system/out/order-system-darwin-arm64/order-system.app/Contents/Resources/app.asar/.vite/build/main.js:1:658)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1311:10)
at Module.load (node:internal/modules/cjs/loader:1098:32)
I revert to 5.1.6 got below error, anyone with me?
Uncaught Exception: Error: Cannot find module 'mock-aws-s3' Require stack: - /Users/wenjoy/workspace/studio/order-system/out/order-system-darwin-arm64/order-system.app/Contents/Resources/app.asar/.vite/build/main.js - at Module._resolveFilename (node:internal/modules/cjs/loader:1055:15) at s._resolveFilename (node:electron/js2c/browser_init:2:115476) at Module._load (node:internal/modules/cjs/loader:908:27) at c._load (node:electron/js2c/node_init:2:13672) at Module.require (node:internal/modules/cjs/loader:1122:19) at require (node:internal/modules/helpers:130:18) at Object.<anonymous> (/Users/wenjoy/workspace/studio/order-system/out/order-system-darwin-arm64/order-system.app/Contents/Resources/app.asar/.vite/build/main.js:1:658) at Module._compile (node:internal/modules/cjs/loader:1256:14) at Module._extensions..js (node:internal/modules/cjs/loader:1311:10) at Module.load (node:internal/modules/cjs/loader:1098:32)
This one works:
export LDFLAGS="-L`brew --prefix`/opt/sqlcipher/lib"
export CPPFLAGS="-I`brew --prefix`/opt/sqlcipher/include/sqlcipher"
npm install sqlite3@5.1.6 --build-from-source --sqlite_libname=sqlcipher --sqlite=`brew --prefix` --runtime=electron --target=27.3.9 --dist-url=https://electronjs.org/headers
node -e 'require("sqlite3")'
Jump in this issue today, my fix are:
I have the same error even with 5.1.6 version :(
我有一个不降低版本的做法:
- 在这里下载版本https://github.com/TryGhost/node-sqlite3/releases(我这里我下载的是sqlite3-v5.1.7-napi-v6-win32-x64.tar.gz)。
- 修改文件名称:
sqlite3-v5.1.7-napi-v6-win32-x64.tar.gz
改为sqlite3-v5.1.7-napi-v36-win32-x64.tar.gz
。注意:我的系统是
Windows x64
,我下载也是对应版本。
- 在你的项目里创建
prebuilds
目录(当然也可以是其他任何地方)。- 在你的项目里创建
.npmrc
文件,文件内容如下:# Set Prebuilds Path sqlite3_local_prebuilds=E:/electron-vite-vue/prebuilds
- 最后一步,将刚才下载的文件移动至
prebuilds
目录下, 文件目录结构如下E:\electron-vite-vue\prebuilds\sqlite3-v5.1.7-napi-v36-win32-x64.tar.gz
- 开始构建项目吧!
pnpm build
在windows中 为什么我指定了路径 无效
Issue Summary
I have used sqlite3 in electron, which can be successfully dev, but the following error will be reported during build. I don't know how I should solve this problem, so I would like to ask if anyone can help me solve this problem. The related dependency versions I use are as follows: The sqlite3 version is 5.1.7, The node-gyp version is 8.4.1. The node version is 16.18.0. The yarn version is 1.22.21
Relevant logs or output
yarn run v1.22.21 $ vue-tsc --noEmit && vite build && electron-builder [unplugin-vue-components] component "Basic"(D:/work/xxx/xxx/src/components/SyncProgress/src/Basic.vue) has naming conflicts with other components, ignored. vite v4.5.1 building for production... node_modules/easemob-websdk/miniCore/miniCore.js (1:7237) Use of eval in "node_modules/easemob-websdk/miniCore/miniCore.js" is strongly discouraged as it poses security risks and may cause issues with minification. node_modules/easemob-websdk/Easemob-chat.js (1:7237) Use of eval in "node_modules/easemob-websdk/Easemob-chat.js" is strongly discouraged as it poses security risks and may cause issues with minification. ✓ 1771 modules transformed. dist/index.html 0.55 kB │ gzip: 0.40 kB dist/assets/head2-58730d9e.jpg 4.94 kB dist/assets/iconfont-f83ad384.ttf 5.21 kB dist/assets/iconfont-43aa91a6.eot 5.38 kB dist/assets/head3-8654d57e.jpg 8.01 kB dist/assets/head1-44e62e25.jpg 8.23 kB dist/assets/head-91484c92.jpg 9.90 kB dist/assets/iconfont-0f08d651.svg 17.06 kB │ gzip: 6.11 kB dist/assets/login-e2a4b4ad.png 247.52 kB dist/assets/index-e066774d.css 0.15 kB │ gzip: 0.14 kB dist/assets/PullPerson-1f2a124e.css 0.22 kB │ gzip: 0.14 kB dist/assets/SingleChat-0bc457f9.css 0.30 kB │ gzip: 0.18 kB dist/assets/SelfChatList-f581c094.css 0.52 kB │ gzip: 0.32 kB dist/assets/index-9e7f23c0.css 0.82 kB │ gzip: 0.38 kB dist/assets/BacklogList-a1abf7d2.css 1.49 kB │ gzip: 0.44 kB dist/assets/el-radio-94b07b0d.css 4.39 kB │ gzip: 0.99 kB dist/assets/GroupChat-1efd6e54.css 43.83 kB │ gzip: 5.22 kB dist/assets/index-19300c20.css 379.31 kB │ gzip: 59.42 kB dist/assets/index-72bdf85a.js 0.49 kB │ gzip: 0.35 kB dist/assets/index-687f6d70.js 0.81 kB │ gzip: 0.56 kB dist/assets/BacklogList-9596c239.js 1.65 kB │ gzip: 0.90 kB dist/assets/PullPerson-d942f364.js 2.62 kB │ gzip: 1.35 kB dist/assets/SelfChatList-07907cbf.js 3.26 kB │ gzip: 1.65 kB dist/assets/SingleChat-05682c53.js 5.31 kB │ gzip: 2.49 kB dist/assets/el-radio-52869d58.js 18.88 kB │ gzip: 7.49 kB dist/assets/GroupChat-4045fd19.js 24.87 kB │ gzip: 7.58 kB dist/assets/index-4b322429.js 2,015.87 kB │ gzip: 572.97 kB
(!) Some chunks are larger than 500 kBs after minification. Consider:
To ensure your native dependencies are always matched electron version, simply add script
"postinstall": "electron-builder install-app-deps" to your
package.json` • writing effective config file=release\1.0.0\builder-effective-config.yaml • 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\user\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 warn install connect ETIMEDOUT 20.205.243.166:443• 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.
error Command failed with exit code 1.
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
16.18.0
How did you install the library?
yarn add sqlite3