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

Error while installing acutual-moneymoney #21

Closed
zigulle opened this issue Jan 15, 2025 · 6 comments · Fixed by #23
Closed

Error while installing acutual-moneymoney #21

zigulle opened this issue Jan 15, 2025 · 6 comments · Fixed by #23
Assignees
Labels
bug Something isn't working

Comments

@zigulle
Copy link

zigulle commented Jan 15, 2025

Hello,
after updating some packages on my MacOS (e.g. node to version 2.3.6), actual-moneymoney no longer started. I have tried to reinstall it, but I get the following error message:

npm -i -g actual-moneymoney

npm error code 1
npm error path /usr/local/lib/node_modules/actual-moneymoney/node_modules/better-sqlite3
npm error command failed
npm error command sh -c prebuild-install || node-gyp rebuild --release
npm error TOUCH ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm error   ACTION deps_sqlite3_gyp_locate_sqlite3_target_copy_builtin_sqlite3 ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm error   TOUCH Release/obj.target/deps/locate_sqlite3.stamp
npm error   CC(target) Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o
npm error   LIBTOOL-STATIC Release/sqlite3.a
npm error   CXX(target) Release/obj.target/better_sqlite3/src/better_sqlite3.o
npm error rm ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm error prebuild-install warn install No prebuilt binaries found (target=23.6.0 runtime=node arch=x64 libc= platform=darwin)
npm error gyp info it worked if it ends with ok
npm error gyp info using [email protected]
npm error gyp info using [email protected] | darwin | x64
npm error gyp info find Python using Python version 3.13.1 found at "/usr/local/opt/[email protected]/bin/python3.13"
npm error gyp info spawn /usr/local/opt/[email protected]/bin/python3.13
npm error gyp info spawn args [
npm error gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm error gyp info spawn args 'binding.gyp',
npm error gyp info spawn args '-f',
npm error gyp info spawn args 'make',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/usr/local/lib/node_modules/actual-moneymoney/node_modules/better-sqlite3/build/config.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/Users/zigulle/Library/Caches/node-gyp/23.6.0/include/node/common.gypi',
npm error gyp info spawn args '-Dlibrary=shared_library',
npm error gyp info spawn args '-Dvisibility=default',
npm error gyp info spawn args '-Dnode_root_dir=/Users/zigulle/Library/Caches/node-gyp/23.6.0',
npm error gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm error gyp info spawn args '-Dnode_lib_file=/Users/zigulle/Library/Caches/node-gyp/23.6.0/<(target_arch)/node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=/usr/local/lib/node_modules/actual-moneymoney/node_modules/better-sqlite3',
npm error gyp info spawn args '-Dnode_engine=v8',
npm error gyp info spawn args '--depth=.',
npm error gyp info spawn args '--no-parallel',
npm error gyp info spawn args '--generator-output',
npm error gyp info spawn args 'build',
npm error gyp info spawn args '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error gyp info spawn make
npm error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm error In file included from ../src/better_sqlite3.cpp:4:
npm error In file included from ./src/better_sqlite3.lzz:11:
npm error In file included from /Users/zigulle/Library/Caches/node-gyp/23.6.0/include/node/node.h:73:
npm error In file included from /Users/zigulle/Library/Caches/node-gyp/23.6.0/include/node/v8.h:23:
npm error In file included from /Users/zigulle/Library/Caches/node-gyp/23.6.0/include/node/cppgc/common.h:8:
npm error /Users/zigulle/Library/Caches/node-gyp/23.6.0/include/node/v8config.h:13:2: error: "C++20 or later required."
npm error    13 | #error "C++20 or later required."
npm error       |  ^
npm error In file included from ../src/better_sqlite3.cpp:4:
npm error ./src/util/macros.lzz:31:69: error: no template named 'CopyablePersistentTraits' in namespace 'v8'; did you mean 'NonCopyablePersistentTraits'?
npm error    31 | template <class T> using CopyablePersistent = v8::Persistent<T, v8::CopyablePersistentTraits<T>>;
npm error       |                                                                 ~~~~^~~~~~~~~~~~~~~~~~~~~~~~
npm error       |                                                                     NonCopyablePersistentTraits
npm error /Users/zigulle/Library/Caches/node-gyp/23.6.0/include/node/v8-persistent-handle.h:223:7: note: 'NonCopyablePersistentTraits' declared here
npm error   223 | class NonCopyablePersistentTraits {
npm error       |       ^
npm error In file included from ../src/better_sqlite3.cpp:4:
npm error ./src/util/macros.lzz:149:6: error: no type named 'AccessorGetterCallback' in namespace 'v8'; did you mean 'AccessorNameGetterCallback'?
npm error   149 |         v8::AccessorGetterCallback func
npm error       |         ~~~~^~~~~~~~~~~~~~~~~~~~~~
npm error       |             AccessorNameGetterCallback
npm error /Users/zigulle/Library/Caches/node-gyp/23.6.0/include/node/v8-object.h:155:7: note: 'AccessorNameGetterCallback' declared here
npm error   155 | using AccessorNameGetterCallback =
npm error       |       ^
npm error ./src/util/macros.lzz:158:6: error: no type named 'AccessorGetterCallback' in namespace 'v8'; did you mean 'AccessorNameGetterCallback'?
npm error   158 |         v8::AccessorGetterCallback func
npm error       |         ~~~~^~~~~~~~~~~~~~~~~~~~~~
npm error       |             AccessorNameGetterCallback
npm error /Users/zigulle/Library/Caches/node-gyp/23.6.0/include/node/v8-object.h:155:7: note: 'AccessorNameGetterCallback' declared here
npm error   155 | using AccessorNameGetterCallback =
npm error       |       ^
npm error ./src/util/macros.lzz:172:28: error: no member named 'SetAccessor' in 'v8::ObjectTemplate'
npm error   172 |         recv->InstanceTemplate()->SetAccessor(
npm error       |         ~~~~~~~~~~~~~~~~~~~~~~~~~~^
npm error ./src/objects/database.lzz:17:17: error: no matching function for call to 'SetPrototypeGetter'
npm error    17 |                 SetPrototypeGetter(isolate, data, t, "open", JS_open);
npm error       |                 ^~~~~~~~~~~~~~~~~~
npm error ./src/util/macros.lzz:153:6: note: candidate function not viable: no known conversion from 'void (v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value> &)' to 'v8::AccessorNameGetterCallback' (aka 'void (*)(Local<Name>, const PropertyCallbackInfo<Value> &)') for 5th argument
npm error   153 | void SetPrototypeGetter(
npm error       |      ^
npm error   154 |         v8::Isolate* isolate,
npm error   155 |         v8::Local<v8::External> data,
npm error   156 |         v8::Local<v8::FunctionTemplate> recv,
npm error   157 |         const char* name,
npm error   158 |         v8::AccessorGetterCallback func
npm error       |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error ./src/objects/database.lzz:18:17: error: no matching function for call to 'SetPrototypeGetter'
npm error    18 |                 SetPrototypeGetter(isolate, data, t, "inTransaction", JS_inTransaction);
npm error       |                 ^~~~~~~~~~~~~~~~~~
npm error ./src/util/macros.lzz:153:6: note: candidate function not viable: no known conversion from 'void (v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value> &)' to 'v8::AccessorNameGetterCallback' (aka 'void (*)(Local<Name>, const PropertyCallbackInfo<Value> &)') for 5th argument
npm error   153 | void SetPrototypeGetter(
npm error       |      ^
npm error   154 |         v8::Isolate* isolate,
npm error   155 |         v8::Local<v8::External> data,
npm error   156 |         v8::Local<v8::FunctionTemplate> recv,
npm error   157 |         const char* name,
npm error   158 |         v8::AccessorGetterCallback func
npm error       |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error ./src/objects/database.lzz:180:21: warning: variable 'status' set but not used [-Wunused-but-set-variable]
npm error   180 |                 int status = sqlite3_db_config(db_handle, SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, 1, NULL);
npm error       |                     ^
npm error ./src/objects/statement.lzz:16:17: error: no matching function for call to 'SetPrototypeGetter'
npm error    16 |                 SetPrototypeGetter(isolate, data, t, "busy", JS_busy);
npm error       |                 ^~~~~~~~~~~~~~~~~~
npm error ./src/util/macros.lzz:153:6: note: candidate function not viable: no known conversion from 'void (v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value> &)' to 'v8::AccessorNameGetterCallback' (aka 'void (*)(Local<Name>, const PropertyCallbackInfo<Value> &)') for 5th argument
npm error   153 | void SetPrototypeGetter(
npm error       |      ^
npm error   154 |         v8::Isolate* isolate,
npm error   155 |         v8::Local<v8::External> data,
npm error   156 |         v8::Local<v8::FunctionTemplate> recv,
npm error   157 |         const char* name,
npm error   158 |         v8::AccessorGetterCallback func
npm error       |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error ./src/util/custom-table.lzz:45:9: warning: missing field 'xIntegrity' initializer [-Wmissing-field-initializers]
npm error    45 |         };
npm error       |         ^
npm error ./src/util/custom-table.lzz:72:9: warning: missing field 'xIntegrity' initializer [-Wmissing-field-initializers]
npm error    72 |         };
npm error       |         ^
npm error 3 warnings and 8 errors generated.
npm error make: *** [Release/obj.target/better_sqlite3/src/better_sqlite3.o] Error 1
npm error gyp ERR! build error 
npm error gyp ERR! stack Error: `make` failed with exit code: 2
npm error gyp ERR! stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:216:23)
npm error gyp ERR! System Darwin 24.2.0
npm error gyp ERR! command "/usr/local/Cellar/node/23.6.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
npm error gyp ERR! cwd /usr/local/lib/node_modules/actual-moneymoney/node_modules/better-sqlite3
npm error gyp ERR! node -v v23.6.0
npm error gyp ERR! node-gyp -v v11.0.0
npm error gyp ERR! not ok
npm error A complete log of this run can be found in: /Users/zigulle/.npm/_logs/2025-01-15T05_33_34_311Z-debug-0.log

Greetings
Daniel

@NikxDa
Copy link
Owner

NikxDa commented Jan 15, 2025

Hi Daniel,

thanks for reporting this. It looks like a dependency of Actual's API package fails to build on your system. Can you try rebuilding with npm rebuild actual-moneymoney and see if that fixes the problem?

If it doesn't, please try uninstalling with npm uninstall -g actual-moneymoney and then reinstalling with npm i -g actual-moneymoney.

If these steps don't work, can you let me know what system you're on and the exact version of Node you are using? There are some more technical solutions there but I'm hoping it solves itself through a somewhat clean reinstall. Your configuration won't be affected by this :)

Cheers
Nik

@NikxDa NikxDa added the needs info Further information is requested label Jan 15, 2025
@zigulle
Copy link
Author

zigulle commented Jan 15, 2025

Hello,

I tried both of your solutions, but it didn't solve the problem.

Here are my versions:

node: 23.6.0
npm: 11.0.0
Python: 3.13.1

System: MacOS 15.2 (Intel)

Greetings,
Daniel

@NikxDa NikxDa added bug Something isn't working and removed needs info Further information is requested labels Jan 16, 2025
@NikxDa
Copy link
Owner

NikxDa commented Jan 16, 2025

Hey Daniel,

so it turns out this is due to a dependency of Actual's API, better-sqlite3. I can theoretically override the dependency for this project, but the latest version, while supporting Node 23, drops support for Node 21, so this would be a major release.

The issue on the Actual side is tracked here: actualbudget/actual#3946

The solution for now should be to downgrade to Node version 18 or 20, but hopefully I have something better for you soon.

@NikxDa NikxDa self-assigned this Jan 16, 2025
@NikxDa
Copy link
Owner

NikxDa commented Jan 16, 2025

To add to the above, you can use a tool like Node Version Manager: https://github.com/nvm-sh/nvm
This allows you to manage multiple Node versions effortlessly on your system, meaning that you can run Actual-MoneyMoney on Node 20 and other apps on newer Node versions without them conflicting.

@NikxDa
Copy link
Owner

NikxDa commented Jan 16, 2025

I saw that the latest release of Actual's API actually fixed this, the issue on their end was just left open.
I've updated the dependency so it now builds correctly on my end. Please update to 2.8.0 and try again!

If the issue persists, please let me know :)

@zigulle
Copy link
Author

zigulle commented Jan 17, 2025

Thanx for your wok, 2.8.0 works very well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants