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

node-gyp or electron-rebuild does not working #1437

Closed
wheeljs opened this issue Jan 31, 2021 · 11 comments
Closed

node-gyp or electron-rebuild does not working #1437

wheeljs opened this issue Jan 31, 2021 · 11 comments

Comments

@wheeljs
Copy link

wheeljs commented Jan 31, 2021

Thanks for the awesome library, and sorry for my English.
I want to use sqlite3 in my electron(fork from [email protected]). When I type yarn add sqlite3, install succeeded, and trigger postinstall to compile sqlite3 for electron. I got some errors below:

× Rebuild Failed

An unhandled error occurred inside electron-rebuild
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp info find Python using Python version 2.7.15 found at "E:\Software\Python27\python.exe"
gyp info find VS using VS2019 (16.8.30907.101) found at:
gyp info find VS "E:\Microsoft Visual Studio\2019\BuildTools"
gyp info find VS run with --verbose for detailed information
gyp info spawn E:\Software\Python27\python.exe
gyp info spawn args [
gyp info spawn args   'E:\\Program\\random-playlist\\node_modules\\electron-rebuild\\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   'E:\\Program\\random-playlist\\app\\node_modules\\sqlite3\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'E:\\Program\\random-playlist\\node_modules\\electron-rebuild\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\TFHOME\\.electron-gyp\\8.5.5\\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\\TFHOME\\.electron-gyp\\8.5.5',
gyp info spawn args   '-Dnode_gyp_dir=E:\\Program\\random-playlist\\node_modules\\electron-rebuild\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\TFHOME\\\\.electron-gyp\\\\8.5.5\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=E:\\Program\\random-playlist\\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   'E:\\Program\\random-playlist\\app\\node_modules\\sqlite3\\build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn E:\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe
gyp info spawn args [
gyp info spawn args   'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64'
gyp info spawn args ]
�ڴ˽��������һ������һ����Ŀ����Ҫ���ò������ɣ������ӡ�-m�����ء�
  nothing.c
  win_delay_load_hook.cc
  nothing.vcxproj -> E:\Program\random-playlist\app\node_modules\sqlite3\build\Release\\nothing.lib
  unpack_sqlite_dep
  sqlite3.c
  win_delay_load_hook.cc
  sqlite3.vcxproj -> E:\Program\random-playlist\app\node_modules\sqlite3\build\Release\\sqlite3.lib
  backup.cc
  database.cc
  node_sqlite3.cc
  statement.cc
  win_delay_load_hook.cc
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(791,24): error C3861: 'napi_create_bigint_int64': identifier not found (compiling source file ..\src\database.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(798,24): error C3861: 'napi_create_bigint_uint64': identifier not found (compiling source file ..\src\database.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(805,24): error C3861: 'napi_create_bigint_words': identifier not found (compiling source file ..\src\database.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(818,24): error C3861: 'napi_get_value_bigint_int64': identifier not found (compiling source file ..\src\database.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(826,24): error C3861: 'napi_get_value_bigint_uint64': identifier not found (compiling source file ..\src\database.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(834,24): error C3861: 'napi_get_value_bigint_words': identifier not found (compiling source file ..\src\database.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(841,24): error C3861: 'napi_get_value_bigint_words': identifier not found (compiling source file ..\src\database.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(1575,24): error C3861: 'napi_is_detached_arraybuffer': identifier not found (compiling source file ..\src\database.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(1581,24): error C3861: 'napi_detach_arraybuffer': identifier not found (compiling source file ..\src\database.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(791,24): error C3861: 'napi_create_bigint_int64': identifier not found (compiling source file ..\src\backup.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(798,24): error C3861: 'napi_create_bigint_uint64': identifier not found (compiling source file ..\src\backup.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(805,24): error C3861: 'napi_create_bigint_words': identifier not found (compiling source file ..\src\backup.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(818,24): error C3861: 'napi_get_value_bigint_int64': identifier not found (compiling source file ..\src\backup.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(826,24): error C3861: 'napi_get_value_bigint_uint64': identifier not found (compiling source file ..\src\backup.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(834,24): error C3861: 'napi_get_value_bigint_words': identifier not found (compiling source file ..\src\backup.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(841,24): error C3861: 'napi_get_value_bigint_words': identifier not found (compiling source file ..\src\backup.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(1575,24): error C3861: 'napi_is_detached_arraybuffer': identifier not found (compiling source file ..\src\backup.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(1581,24): error C3861: 'napi_detach_arraybuffer': identifier not found (compiling source file ..\src\backup.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(791,24): error C3861: 'napi_create_bigint_int64': identifier not found (compiling source file ..\src\statement.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(798,24): error C3861: 'napi_create_bigint_uint64': identifier not found (compiling source file ..\src\statement.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(805,24): error C3861: 'napi_create_bigint_words': identifier not found (compiling source file ..\src\statement.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(818,24): error C3861: 'napi_get_value_bigint_int64': identifier not found (compiling source file ..\src\statement.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(826,24): error C3861: 'napi_get_value_bigint_uint64': identifier not found (compiling source file ..\src\statement.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(834,24): error C3861: 'napi_get_value_bigint_words': identifier not found (compiling source file ..\src\statement.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(841,24): error C3861: 'napi_get_value_bigint_words': identifier not found (compiling source file ..\src\statement.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(1575,24): error C3861: 'napi_is_detached_arraybuffer': identifier not found (compiling source file ..\src\statement.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(1581,24): error C3861: 'napi_detach_arraybuffer': identifier not found (compiling source file ..\src\statement.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(791,24): error C3861: 'napi_create_bigint_int64': identifier not found (compiling source file ..\src\node_sqlite3.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(798,24): error C3861: 'napi_create_bigint_uint64': identifier not found (compiling source file ..\src\node_sqlite3.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(805,24): error C3861: 'napi_create_bigint_words': identifier not found (compiling source file ..\src\node_sqlite3.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(818,24): error C3861: 'napi_get_value_bigint_int64': identifier not found (compiling source file ..\src\node_sqlite3.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(826,24): error C3861: 'napi_get_value_bigint_uint64': identifier not found (compiling source file ..\src\node_sqlite3.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(834,24): error C3861: 'napi_get_value_bigint_words': identifier not found (compiling source file ..\src\node_sqlite3.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(841,24): error C3861: 'napi_get_value_bigint_words': identifier not found (compiling source file ..\src\node_sqlite3.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(1575,24): error C3861: 'napi_is_detached_arraybuffer': identifier not found (compiling source file ..\src\node_sqlite3.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(1581,24): error C3861: 'napi_detach_arraybuffer': identifier not found (compiling source file ..\src\node_sqlite3.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `E:\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (E:\Program\random-playlist\node_modules\electron-rebuild\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Windows_NT 10.0.19041
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\Program\\random-playlist\\node_modules\\electron-rebuild\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=8.5.5" "--arch=x64" "--dist-url=https://www.electronjs.org/headers" "--build-from-source" "--module_name=node_sqlite3" "--module_path=E:\\Program\\random-playlist\\app\\node_modules\\sqlite3\\lib\\binding\\napi-v{napi_build_version}-win32-x64" "--host=https://mapbox-node-binary.s3.amazonaws.com" "--remote_path=./{name}/v5.0.1/{toolset}/" "--package_name=napi-v{napi_build_version}-win32-x64.tar.gz" "--msvs_version=2015"
gyp ERR! cwd E:\Program\random-playlist\app\node_modules\sqlite3
gyp ERR! node -v v14.15.4
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok

Failed with exit code: 1

Error: gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp info find Python using Python version 2.7.15 found at "E:\Software\Python27\python.exe"
gyp info find VS using VS2019 (16.8.30907.101) found at:
gyp info find VS "E:\Microsoft Visual Studio\2019\BuildTools"
gyp info find VS run with --verbose for detailed information
gyp info spawn E:\Software\Python27\python.exe
gyp info spawn args [
gyp info spawn args   'E:\\Program\\random-playlist\\node_modules\\electron-rebuild\\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   'E:\\Program\\random-playlist\\app\\node_modules\\sqlite3\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'E:\\Program\\random-playlist\\node_modules\\electron-rebuild\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\TFHOME\\.electron-gyp\\8.5.5\\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\\TFHOME\\.electron-gyp\\8.5.5',
gyp info spawn args   '-Dnode_gyp_dir=E:\\Program\\random-playlist\\node_modules\\electron-rebuild\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\TFHOME\\\\.electron-gyp\\\\8.5.5\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=E:\\Program\\random-playlist\\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   'E:\\Program\\random-playlist\\app\\node_modules\\sqlite3\\build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn E:\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe
gyp info spawn args [
gyp info spawn args   'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64'
gyp info spawn args ]
�ڴ˽��������һ������һ����Ŀ����Ҫ���ò������ɣ������ӡ�-m�����ء�
  nothing.c
  win_delay_load_hook.cc
  nothing.vcxproj -> E:\Program\random-playlist\app\node_modules\sqlite3\build\Release\\nothing.lib
  unpack_sqlite_dep
  sqlite3.c
  win_delay_load_hook.cc
  sqlite3.vcxproj -> E:\Program\random-playlist\app\node_modules\sqlite3\build\Release\\sqlite3.lib
  backup.cc
  database.cc
  node_sqlite3.cc
  statement.cc
  win_delay_load_hook.cc
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(791,24): error C3861: 'napi_create_bigint_int64': identifier not found (compiling source file ..\src\database.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(798,24): error C3861: 'napi_create_bigint_uint64': identifier not found (compiling source file ..\src\database.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(805,24): error C3861: 'napi_create_bigint_words': identifier not found (compiling source file ..\src\database.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(818,24): error C3861: 'napi_get_value_bigint_int64': identifier not found (compiling source file ..\src\database.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(826,24): error C3861: 'napi_get_value_bigint_uint64': identifier not found (compiling source file ..\src\database.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(834,24): error C3861: 'napi_get_value_bigint_words': identifier not found (compiling source file ..\src\database.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(841,24): error C3861: 'napi_get_value_bigint_words': identifier not found (compiling source file ..\src\database.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(1575,24): error C3861: 'napi_is_detached_arraybuffer': identifier not found (compiling source file ..\src\database.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(1581,24): error C3861: 'napi_detach_arraybuffer': identifier not found (compiling source file ..\src\database.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(791,24): error C3861: 'napi_create_bigint_int64': identifier not found (compiling source file ..\src\backup.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(798,24): error C3861: 'napi_create_bigint_uint64': identifier not found (compiling source file ..\src\backup.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(805,24): error C3861: 'napi_create_bigint_words': identifier not found (compiling source file ..\src\backup.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(818,24): error C3861: 'napi_get_value_bigint_int64': identifier not found (compiling source file ..\src\backup.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(826,24): error C3861: 'napi_get_value_bigint_uint64': identifier not found (compiling source file ..\src\backup.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(834,24): error C3861: 'napi_get_value_bigint_words': identifier not found (compiling source file ..\src\backup.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(841,24): error C3861: 'napi_get_value_bigint_words': identifier not found (compiling source file ..\src\backup.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(1575,24): error C3861: 'napi_is_detached_arraybuffer': identifier not found (compiling source file ..\src\backup.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(1581,24): error C3861: 'napi_detach_arraybuffer': identifier not found (compiling source file ..\src\backup.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(791,24): error C3861: 'napi_create_bigint_int64': identifier not found (compiling source file ..\src\statement.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(798,24): error C3861: 'napi_create_bigint_uint64': identifier not found (compiling source file ..\src\statement.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(805,24): error C3861: 'napi_create_bigint_words': identifier not found (compiling source file ..\src\statement.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(818,24): error C3861: 'napi_get_value_bigint_int64': identifier not found (compiling source file ..\src\statement.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(826,24): error C3861: 'napi_get_value_bigint_uint64': identifier not found (compiling source file ..\src\statement.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(834,24): error C3861: 'napi_get_value_bigint_words': identifier not found (compiling source file ..\src\statement.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(841,24): error C3861: 'napi_get_value_bigint_words': identifier not found (compiling source file ..\src\statement.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(1575,24): error C3861: 'napi_is_detached_arraybuffer': identifier not found (compiling source file ..\src\statement.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(1581,24): error C3861: 'napi_detach_arraybuffer': identifier not found (compiling source file ..\src\statement.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(791,24): error C3861: 'napi_create_bigint_int64': identifier not found (compiling source file ..\src\node_sqlite3.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(798,24): error C3861: 'napi_create_bigint_uint64': identifier not found (compiling source file ..\src\node_sqlite3.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(805,24): error C3861: 'napi_create_bigint_words': identifier not found (compiling source file ..\src\node_sqlite3.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(818,24): error C3861: 'napi_get_value_bigint_int64': identifier not found (compiling source file ..\src\node_sqlite3.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(826,24): error C3861: 'napi_get_value_bigint_uint64': identifier not found (compiling source file ..\src\node_sqlite3.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(834,24): error C3861: 'napi_get_value_bigint_words': identifier not found (compiling source file ..\src\node_sqlite3.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(841,24): error C3861: 'napi_get_value_bigint_words': identifier not found (compiling source file ..\src\node_sqlite3.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(1575,24): error C3861: 'napi_is_detached_arraybuffer': identifier not found (compiling source file ..\src\node_sqlite3.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
E:\Program\random-playlist\app\node_modules\node-addon-api\napi-inl.h(1581,24): error C3861: 'napi_detach_arraybuffer': identifier not found (compiling source file ..\src\node_sqlite3.cc) [E:\Program\random-playlist\app\node_modules\sqlite3\build\node_sqlite3.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `E:\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (E:\Program\random-playlist\node_modules\electron-rebuild\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Windows_NT 10.0.19041
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\Program\\random-playlist\\node_modules\\electron-rebuild\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=8.5.5" "--arch=x64" "--dist-url=https://www.electronjs.org/headers" "--build-from-source" "--module_name=node_sqlite3" "--module_path=E:\\Program\\random-playlist\\app\\node_modules\\sqlite3\\lib\\binding\\napi-v{napi_build_version}-win32-x64" "--host=https://mapbox-node-binary.s3.amazonaws.com" "--remote_path=./{name}/v5.0.1/{toolset}/" "--package_name=napi-v{napi_build_version}-win32-x64.tar.gz" "--msvs_version=2015"
gyp ERR! cwd E:\Program\random-playlist\app\node_modules\sqlite3
gyp ERR! node -v v14.15.4
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok

Failed with exit code: 1
    at SafeSubscriber._error (E:\Program\random-playlist\node_modules\spawn-rx\lib\src\index.js:267:84)
    at SafeSubscriber.__tryOrUnsub (E:\Program\random-playlist\node_modules\rxjs\internal\Subscriber.js:205:16)
    at SafeSubscriber.error (E:\Program\random-playlist\node_modules\rxjs\internal\Subscriber.js:156:26)
    at Subscriber._error (E:\Program\random-playlist\node_modules\rxjs\internal\Subscriber.js:92:26)
    at Subscriber.error (E:\Program\random-playlist\node_modules\rxjs\internal\Subscriber.js:72:18)
    at MapSubscriber.Subscriber._error (E:\Program\random-playlist\node_modules\rxjs\internal\Subscriber.js:92:26)
    at MapSubscriber.Subscriber.error (E:\Program\random-playlist\node_modules\rxjs\internal\Subscriber.js:72:18)
    at SafeSubscriber._next (E:\Program\random-playlist\node_modules\spawn-rx\lib\src\index.js:242:65)
    at SafeSubscriber.__tryOrUnsub (E:\Program\random-playlist\node_modules\rxjs\internal\Subscriber.js:205:16)
    at SafeSubscriber.next (E:\Program\random-playlist\node_modules\rxjs\internal\Subscriber.js:143:22)
child_process.js:655
    throw err;
    ^

Error: Command failed: ..\node_modules\.bin\electron-rebuild --parallel --force --types prod,dev,optional --module-dir .
    at checkExecSyncError (child_process.js:616:11)
    at execSync (child_process.js:652:15)
    at Object.<anonymous> (E:\Program\random-playlist\internals\scripts\/ElectronRebuild.js:18:3)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Module._compile (E:\Program\random-playlist\node_modules\pirates\lib\index.js:99:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Object.newLoader [as .js] (E:\Program\random-playlist\node_modules\pirates\lib\index.js:104:7)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {
  status: 4294967295,
  signal: null,
  output: [ null, null, null ],
  pid: 22668,
  stdout: null,
  stderr: null
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

postintsall script:

{
  "scripts": {
    "electron-rebuild": "node -r ../internals/scripts/BabelRegister.js ../internals/scripts/ElectronRebuild.js",
    "postinstall": "yarn electron-rebuild"
  }
}

ElectronRebuild.js:

import path from 'path';
import { execSync } from 'child_process';
import fs from 'fs';
import { dependencies } from '../../app/package.json';

const nodeModulesPath = path.join(__dirname, '..', '..', 'app', 'node_modules');

if (
  Object.keys(dependencies || {}).length > 0 &&
  fs.existsSync(nodeModulesPath)
) {
  const electronRebuildCmd =
    '../node_modules/.bin/electron-rebuild --parallel --force --types prod,dev,optional --module-dir .';
  const cmd =
    process.platform === 'win32'
      ? (electronRebuildCmd.replace(/\//g, '\\')/* + ' --dist-url http://localhost/headers/'*/)
      : electronRebuildCmd;
  execSync(cmd, {
    cwd: path.join(__dirname, '..', '..', 'app'),
    stdio: 'inherit',
  });
}

Environment:
Windows 10 x64
Manually install node-gyp dependencies VSBuildTools 2019

$ npm -v
6.14.10
$ node -v
v14.15.4
$ npm config get msvs_version
2019

How can I make it works or use another module instead?
Thanks for your help.

@wheeljs
Copy link
Author

wheeljs commented Jan 31, 2021

I tried Using npm and Manually Build for Electron, it looks same.

So I'm not sure I have installed node-gyp's dependencies correctly.

@pranshuchittora
Copy link

Same issue, not working. Tried with Node v12 & v14.
OS -> Ubuntu
Python, Yarn, gcc, g++ and other deps installed.
Tried build from source flag as well, unfortunately issue not resolving.

@radarsu
Copy link

radarsu commented Feb 4, 2021

Same issue, tested using python2 and python3 during builds, also using npm install mapbox/node-sqlite3 over sqlite3 didn't work. Now trying to use better-sqlite3 (with TypeORM) instead.

@justorez
Copy link

justorez commented Feb 8, 2021

[email protected] build failed. Using [email protected] was work.

npm install [email protected] --build-from-source --runtime=electron --target=9.3.5 --dist-url=https://electronjs.org/headers --target_arch=ia32

@k-matsuzawa
Copy link

I ran into the same problem. I think there are two problems:

  • The NAPI function you are using looks like the one with NAPI version 7.
  • The NAPI version supported by electron looks like electron11 is 5 or less and electron12 is 7 or more.

When using electron11 or less, it seems better to use sqlite v5.0.0.

@k-matsuzawa
Copy link

Should I set napi_build_version?
electron/rebuild#554

@madfatihid
Copy link

I ran into the same problem. I think there are two problems:

  • The NAPI function you are using looks like the one with NAPI version 7.
  • The NAPI version supported by electron looks like electron11 is 5 or less and electron12 is 7 or more.

When using electron11 or less, it seems better to use sqlite v5.0.0.

Thanks @k-matsuzawa, it worked!
I was using electron 11, more specifically Electron React Boilerplate 2.3.0 which was using electron 11. After downgrading to SQLite v5.0.0, the rebuild worked and electron run perfectly.

@ifelere
Copy link

ifelere commented Jun 30, 2021

Thank you @justorez

@c0derGitHub
Copy link

use [email protected] , thanks @justorez .
or use [email protected], as I use ts.

@tharukeRajapaksha123
Copy link

This works for me.Thank you

@ErisDS
Copy link
Member

ErisDS commented Apr 13, 2022

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

@ErisDS ErisDS closed this as completed Apr 13, 2022
tradzero pushed a commit to tradzero/LiveAutoRecord that referenced this issue Oct 24, 2022
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

10 participants