funmaker / Hybooru

Hydrus-based booru-styled imageboard in React
https://booru.funmaker.moe/
MIT License
95 stars 15 forks source link

npm install fails after better-sqlite3 #19

Closed sbstratos79 closed 1 year ago

sbstratos79 commented 1 year ago

npm install fails on both the release zip and the cloned repo.

2656 info run better-sqlite3@7.1.4 install node_modules/better-sqlite3 prebuild-install || npm run build-release
2657 info run better-sqlite3@7.1.4 install { code: 1, signal: null }
2658 timing reify:rollback:createSparse Completed in 755ms
2659 timing reify:rollback:retireShallow Completed in 0ms
2660 timing command:install Completed in 77731ms
2661 verbose stack Error: command failed
2661 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:53:27)
2661 verbose stack     at ChildProcess.emit (node:events:513:28)
2661 verbose stack     at maybeClose (node:internal/child_process:1098:16)
2661 verbose stack     at ChildProcess._handle.onexit (node:internal/child_process:304:5)
2662 verbose pkgid better-sqlite3@7.1.4
2663 verbose cwd /mnt/HDD/Home/Documents/Linux/git-clones/Hybooru
2664 verbose Linux 6.0.11-arch1-1
2665 verbose node v19.2.0
2666 verbose npm  v9.1.3
2667 error code 1
2668 error path /mnt/HDD/Home/Documents/Linux/git-clones/Hybooru/node_modules/better-sqlite3
2669 error command failed
2670 error command sh -c prebuild-install || npm run build-release
2671 error > better-sqlite3@7.1.4 build-release
2671 error > node-gyp rebuild --release
2671 error
2671 error make: Entering directory '/mnt/HDD/Home/Documents/Linux/git-clones/Hybooru/node_modules/better-sqlite3/build'
2671 error   TOUCH b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
2671 error   ACTION deps_sqlite3_gyp_locate_sqlite3_target_extract_sqlite3 b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
2671 error   TOUCH Release/obj.target/deps/locate_sqlite3.stamp
2671 error   CC(target) Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o
2671 error rm -f Release/obj.target/deps/sqlite3.a Release/obj.target/deps/sqlite3.a.ar-file-list; mkdir -p `dirname Release/obj.target/deps/sqlite3.a`
2671 error ar crs Release/obj.target/deps/sqlite3.a @Release/obj.target/deps/sqlite3.a.ar-file-list
2671 error   COPY Release/sqlite3.a
2671 error   CXX(target) Release/obj.target/better_sqlite3/src/better_sqlite3.o
2671 error rm b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
2671 error make: Leaving directory '/mnt/HDD/Home/Documents/Linux/git-clones/Hybooru/node_modules/better-sqlite3/build'
2672 error prebuild-install WARN install No prebuilt binaries found (target=19.2.0 runtime=node arch=x64 libc= platform=linux)
2672 error gyp info it worked if it ends with ok
2672 error gyp info using node-gyp@9.3.0
2672 error gyp info using node@19.2.0 | linux | x64
2672 error gyp info find Python using Python version 3.9.12 found at "/opt/miniconda3/bin/python3"
2672 error gyp info spawn /opt/miniconda3/bin/python3
2672 error gyp info spawn args [
2672 error gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
2672 error gyp info spawn args   'binding.gyp',
2672 error gyp info spawn args   '-f',
2672 error gyp info spawn args   'make',
2672 error gyp info spawn args   '-I',
2672 error gyp info spawn args   '/mnt/HDD/Home/Documents/Linux/git-clones/Hybooru/node_modules/better-sqlite3/build/config.gypi',
2672 error gyp info spawn args   '-I',
2672 error gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
2672 error gyp info spawn args   '-I',
2672 error gyp info spawn args   '/home/sbstratos79/.cache/node-gyp/19.2.0/include/node/common.gypi',
2672 error gyp info spawn args   '-Dlibrary=shared_library',
2672 error gyp info spawn args   '-Dvisibility=default',
2672 error gyp info spawn args   '-Dnode_root_dir=/home/sbstratos79/.cache/node-gyp/19.2.0',
2672 error gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
2672 error gyp info spawn args   '-Dnode_lib_file=/home/sbstratos79/.cache/node-gyp/19.2.0/<(target_arch)/node.lib',
2672 error gyp info spawn args   '-Dmodule_root_dir=/mnt/HDD/Home/Documents/Linux/git-clones/Hybooru/node_modules/better-sqlite3',
2672 error gyp info spawn args   '-Dnode_engine=v8',
2672 error gyp info spawn args   '--depth=.',
2672 error gyp info spawn args   '--no-parallel',
2672 error gyp info spawn args   '--generator-output',
2672 error gyp info spawn args   'build',
2672 error gyp info spawn args   '-Goutput_dir=.'
2672 error gyp info spawn args ]
2672 error gyp info spawn make
2672 error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
2672 error In file included from ./src/better_sqlite3.lzz:10,
2672 error                  from ../src/better_sqlite3.cpp:4:
2672 error /home/sbstratos79/.cache/node-gyp/19.2.0/include/node/node.h:1013:7: warning: cast between incompatible function types from ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Context>)’ to ‘node::addon_context_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Context>, void*)’} [-Wcast-function-type]
2672 error  1013 |       (node::addon_context_register_func) (regfunc),                  \
2672 error       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2672 error /home/sbstratos79/.cache/node-gyp/19.2.0/include/node/node.h:1031:3: note: in expansion of macro ‘NODE_MODULE_CONTEXT_AWARE_X’
2672 error  1031 |   NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, NULL, 0)
2672 error       |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
2672 error /home/sbstratos79/.cache/node-gyp/19.2.0/include/node/node.h:1062:3: note: in expansion of macro ‘NODE_MODULE_CONTEXT_AWARE’
2672 error  1062 |   NODE_MODULE_CONTEXT_AWARE(NODE_GYP_MODULE_NAME,                     \
2672 error       |   ^~~~~~~~~~~~~~~~~~~~~~~~~
2672 error ./src/better_sqlite3.lzz:61:1: note: in expansion of macro ‘NODE_MODULE_INIT’
2672 error ./src/util/macros.lzz: In function ‘void SetPrototypeGetter(v8::Isolate*, v8::Local<v8::External>, v8::Local<v8::FunctionTemplate>, const char*, v8::AccessorGetterCallback)’:
2672 error ./src/util/macros.lzz:173:21: error: ‘v8::AccessorSignature’ has not been declared
2672 error ./src/util/binder.lzz: In static member function ‘static bool Binder::IsPlainObject(v8::Isolate*, v8::Local<v8::Object>)’:
2672 error ./src/util/binder.lzz:36:51: error: ‘class v8::Object’ has no member named ‘CreationContext’; did you mean ‘GetCreationContext’?
2672 error ./src/util/data.lzz: In function ‘v8::Local<v8::Value> Data::GetValueJS(v8::Isolate*, sqlite3_stmt*, int, bool)’:
2672 error ./src/util/data.lzz:75:92: warning: this statement may fall through [-Wimplicit-fallthrough=]
2672 error ./src/util/data.lzz:75:197: note: here
2672 error ./src/util/data.lzz: In function ‘v8::Local<v8::Value> Data::GetValueJS(v8::Isolate*, sqlite3_value*, bool)’:
2672 error ./src/util/data.lzz:79:81: warning: this statement may fall through [-Wimplicit-fallthrough=]
2672 error ./src/util/data.lzz:79:175: note: here
2672 error make: *** [better_sqlite3.target.mk:123: Release/obj.target/better_sqlite3/src/better_sqlite3.o] Error 1
2672 error gyp ERR! build error 
2672 error gyp ERR! stack Error: `make` failed with exit code: 2
2672 error gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
2672 error gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
2672 error gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:293:12)
2672 error gyp ERR! System Linux 6.0.11-arch1-1
2672 error gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
2672 error gyp ERR! cwd /mnt/HDD/Home/Documents/Linux/git-clones/Hybooru/node_modules/better-sqlite3
2672 error gyp ERR! node -v v19.2.0
2672 error gyp ERR! node-gyp -v v9.3.0
2672 error gyp ERR! not ok
2673 verbose exit 1
2674 timing npm Completed in 77775ms
2675 verbose unfinished npm timer reify 1670272300749
2676 verbose unfinished npm timer reify:build 1670272309343
2677 verbose unfinished npm timer build 1670272309344
2678 verbose unfinished npm timer build:deps 1670272309344
2679 verbose unfinished npm timer build:run:install 1670272309378
2680 verbose unfinished npm timer build:run:install:node_modules/better-sqlite3 1670272309378
2681 verbose code 1

Relevant issue on better-sqlite3 repo. I think better-sqlite3 dependency should be updated.

funmaker commented 1 year ago

Generally I'll be targetting Node 18 LTS for a while, but I will check that better-sqlite3 and will update if it works on both 18 and 19.

funmaker commented 1 year ago

Should be working fine in v1.6.0. Reopen if the issue persists.