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

gyp: Undefined variable napi_build_version in binding.gyp while trying to load binding.gyp #1359

Closed
baobao12356 opened this issue Jul 17, 2020 · 8 comments

Comments

@baobao12356
Copy link

执行
node-gyp rebuild --target=5.0.2 --arch=ia32 --target_platform=win32 --dist-url=https://atom.io/download/electron/ --module_name=node_sqlite3 --module_path=../lib/binding/electron-v5.0-win32-ia32
报错如下:

gyp: Undefined variable napi_build_version in 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 (C:\Users\shzto\AppData\Roaming\npm\node_modules\node-gyp\lib\configure.js:350:16)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\shzto\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--target=7.1.2" "--arch=ia32" "--target_platform=win32" "--dist-url=https://atom.io/download/electron/" "--module_name=node_sqlite3" "--module_path=../lib/binding/electron-v7.1-win32-ia32"
gyp ERR! cwd D:\xaingmu\gitlab\im-web\im-desktop\node_modules\sqlite3
gyp ERR! node -v v11.4.0
gyp ERR! node-gyp -v v7.0.0
gyp ERR! not ok

image

@baobao12356
Copy link
Author

各位大佬有遇到过得麻烦解答一下,谢谢

@marcosroriz
Copy link

I'm having the same issue. Anyone know how to fix this?

@soumen-saniel
Copy link

I was having the same issue in mac.
If you are on mac
Try upgrading to latest node version and latest npm version
And then run
npm i -g node-gyp@latest && npm config set node_gyp "/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js"

@Niek
Copy link

Niek commented Oct 29, 2020

Running npm i node-gyp@latest resolved the issue for me.

@i-chaochen
Copy link

Same issue here.

electron cannot find sqlite3 module

tried many ways to rebuild sqlite3 but all failed

@joshuanathanson
Copy link

It looks like you need at least node 10.23.0 as noted in this issue: nodejs/node-gyp#2224
In that issue, it mentions that the fix was never backported to node 10.x. A little more digging indicates that node 10.23.0 was the version it was backported to, as seen in this PR: nodejs/node#27835

@daniellockyer
Copy link
Member

Would you be able to try with v5.0.3? 🙂

@w1i2n3d4
Copy link

w1i2n3d4 commented Nov 7, 2024

Uploading image.png…

image

请问如何解决这个问题,我最近也遇到了

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

No branches or pull requests

8 participants