npm install ffi-napi
npm ERR! code 1
npm ERR! path /Users/zoujiaqing/projects/node_modules/ffi-napi
npm ERR! command failed
npm ERR! command sh -c node-gyp-build
npm ERR! CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
npm ERR! LIBTOOL-STATIC Release/nothing.a
npm ERR! CC(target) Release/obj.target/ffi/deps/libffi/src/prep_cif.o
npm ERR! CC(target) Release/obj.target/ffi/deps/libffi/src/types.o
npm ERR! CC(target) Release/obj.target/ffi/deps/libffi/src/raw_api.o
npm ERR! CC(target) Release/obj.target/ffi/deps/libffi/src/java_raw_api.o
npm ERR! CC(target) Release/obj.target/ffi/deps/libffi/src/closures.o
npm ERR! CC(target) Release/obj.target/ffi/deps/libffi/src/aarch64/ffi.o
npm ERR! CC(target) Release/obj.target/ffi/deps/libffi/src/aarch64/sysv.o
npm ERR! LIBTOOL-STATIC Release/libffi.a
npm ERR! CXX(target) Release/obj.target/ffi_bindings/src/ffi.o
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@10.0.1
npm ERR! gyp info using node@21.6.0 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.11.7 found at "/opt/homebrew/opt/python@3.11/bin/python3.11"
npm ERR! gyp info spawn /opt/homebrew/opt/python@3.11/bin/python3.11
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/zoujiaqing/projects/node_modules/ffi-napi/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/zoujiaqing/Library/Caches/node-gyp/21.6.0/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/Users/zoujiaqing/Library/Caches/node-gyp/21.6.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/zoujiaqing/Library/Caches/node-gyp/21.6.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/zoujiaqing/projects/node_modules/ffi-napi',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols)
npm ERR! ../deps/libffi/src/java_raw_api.c:328:46: warning: 'ffi_java_raw_size' is deprecated [-Wdeprecated-declarations]
npm ERR! ffi_java_raw *raw = (ffi_java_raw*)alloca (ffi_java_raw_size (cif));
npm ERR! ^
npm ERR! ../deps/libffi/config/mac/arm64/ffi.h:299:56: note: 'ffi_java_raw_size' has been explicitly marked deprecated here
npm ERR! size_t ffi_java_raw_size (ffi_cif *cif) __attribute__((deprecated));
npm ERR! ^
npm ERR! ../deps/libffi/src/java_raw_api.c:331:3: warning: 'ffi_java_ptrarray_to_raw' is deprecated [-Wdeprecated-declarations]
npm ERR! ffi_java_ptrarray_to_raw (cif, avalue, raw);
npm ERR! ^
npm ERR! ../deps/libffi/config/mac/arm64/ffi.h:295:93: note: 'ffi_java_ptrarray_to_raw' has been explicitly marked deprecated here
npm ERR! void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw) __attribute__((deprecated));
npm ERR! ^
npm ERR! 2 warnings generated.
npm ERR! ../deps/libffi/src/aarch64/ffi.c:738:17: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
npm ERR! if (i + 1 == cif->aarch64_nfixedargs)
npm ERR! ~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../deps/libffi/src/aarch64/ffi.c:991:17: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
npm ERR! if (i + 1 == cif->aarch64_nfixedargs)
npm ERR! ~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! 2 warnings generated.
npm ERR! In file included from ../src/ffi.cc:5:
npm ERR! /Users/zoujiaqing/projects/node_modules/get-uv-event-loop-napi-h/include/get-uv-event-loop-napi.h:26:30: error: incompatible function pointer types assigning to 'get_uv_event_loop_fn' (aka 'napi_status (*)(napi_env__ *, uv_loop_s **)') from 'napi_status (*)(node_api_nogc_env, struct uv_loop_s **)' (aka 'napi_status (*)(const napi_env__ *, uv_loop_s **)')
npm ERR! napi_get_uv_event_loop__ = &napi_get_uv_event_loop;
npm ERR! ^~~~~~~~~~~~~~~~~~~~~~~
npm ERR! In file included from ../src/ffi.cc:3:
npm ERR! In file included from ../src/ffi.h:2:
npm ERR! In file included from /Users/zoujiaqing/projects/node_modules/node-addon-api/napi.h:2725:
npm ERR! /Users/zoujiaqing/projects/node_modules/node-addon-api/napi-inl.h:63:12: error: no matching function for call to 'napi_add_finalizer'
npm ERR! status = napi_add_finalizer(env, obj, data, finalizer, hint, nullptr);
npm ERR! ^~~~~~~~~~~~~~~~~~
npm ERR! /Users/zoujiaqing/projects/node_modules/node-addon-api/napi-inl.h:1965:29: note: in instantiation of function template specialization 'Napi::details::AttachData<Napi::details::CallbackData<Napi::Value (*)(const Napi::CallbackInfo &), Napi::Value>>' requested here
npm ERR! status = Napi::details::AttachData(env, *result, data);
npm ERR! ^
npm ERR! /Users/zoujiaqing/projects/node_modules/node-addon-api/napi-inl.h:2021:24: note: in instantiation of function template specialization 'Napi::CreateFunction<Napi::details::CallbackData<Napi::Value (*)(const Napi::CallbackInfo &), Napi::Value>>' requested here
npm ERR! napi_status status = CreateFunction(env,
npm ERR! ^
npm ERR! ../src/ffi.cc:58:38: note: in instantiation of function template specialization 'Napi::Function::New<Napi::Value (*)(const Napi::CallbackInfo &)>' requested here
npm ERR! target["ffi_prep_cif"] = Function::New(env, FFIPrepCif);
npm ERR! ^
npm ERR! /Users/zoujiaqing/Library/Caches/node-gyp/21.6.0/include/node/js_native_api.h:513:1: note: candidate function not viable: no known conversion from 'napi_finalize' (aka 'void (*)(napi_env__ *, void *, void *)') to 'node_api_nogc_finalize' (aka 'void (*)(const napi_env__ *, void *, void *)') for 4th argument
npm ERR! napi_add_finalizer(napi_env env,
npm ERR! ^
npm ERR! In file included from ../src/ffi.cc:3:
npm ERR! In file included from ../src/ffi.h:2:
npm ERR! In file included from /Users/zoujiaqing/projects/node_modules/node-addon-api/napi.h:2725:
npm ERR! /Users/zoujiaqing/projects/node_modules/node-addon-api/napi-inl.h:63:12: error: no matching function for call to 'napi_add_finalizer'
npm ERR! status = napi_add_finalizer(env, obj, data, finalizer, hint, nullptr);
npm ERR! ^~~~~~~~~~~~~~~~~~
npm ERR! /Users/zoujiaqing/projects/node_modules/node-addon-api/napi-inl.h:1965:29: note: in instantiation of function template specialization 'Napi::details::AttachData<Napi::details::CallbackData<void (*)(const Napi::CallbackInfo &), void>>' requested here
npm ERR! status = Napi::details::AttachData(env, *result, data);
npm ERR! ^
npm ERR! /Users/zoujiaqing/projects/node_modules/node-addon-api/napi-inl.h:2021:24: note: in instantiation of function template specialization 'Napi::CreateFunction<Napi::details::CallbackData<void (*)(const Napi::CallbackInfo &), void>>' requested here
npm ERR! napi_status status = CreateFunction(env,
npm ERR! ^
npm ERR! ../src/ffi.cc:60:34: note: in instantiation of function template specialization 'Napi::Function::New<void (*)(const Napi::CallbackInfo &)>' requested here
npm ERR! target["ffi_call"] = Function::New(env, FFICall);
npm ERR! ^
npm ERR! /Users/zoujiaqing/Library/Caches/node-gyp/21.6.0/include/node/js_native_api.h:513:1: note: candidate function not viable: no known conversion from 'napi_finalize' (aka 'void (*)(napi_env__ *, void *, void *)') to 'node_api_nogc_finalize' (aka 'void (*)(const napi_env__ *, void *, void *)') for 4th argument
npm ERR! napi_add_finalizer(napi_env env,
npm ERR! ^
npm ERR! 3 errors generated.
npm ERR! make: *** [Release/obj.target/ffi_bindings/src/ffi.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.<anonymous> (/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)
npm ERR! gyp ERR! System Darwin 23.2.0
npm ERR! gyp ERR! command "/opt/homebrew/Cellar/node/21.6.0/bin/node" "/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /Users/zoujiaqing/projects/node_modules/ffi-napi
npm ERR! gyp ERR! node -v v21.6.0
npm ERR! gyp ERR! node-gyp -v v10.0.1
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in: /Users/zoujiaqing/.npm/_logs/2024-01-22T04_42_26_345Z-debug-0.log