[GH-ISSUE #726] [Bug]: Node 19 unsupported #41947

Closed
opened 2026-04-26 01:29:03 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @0rnella on GitHub (Mar 5, 2023).
Original GitHub issue: https://github.com/actualbudget/actual/issues/726

Verified issue does not already exist?

  • I have searched and found no related existing issue for node 19 or better-sqlite3

What happened?

When installing this repo, one dependency could repeatedly not be built: better-sqlite3!

Eventually, when I realized that fly.io was doing just fine with building the repo, and that they use node@14, I downgraded my local node version from 19.7.0 to the latest node@18: 18.14.2. That did the trick.

My diagnosis is that sql-lite3 version ^7.5.0 is not compatible with node@19.

One solution could be to upgrade it: it does look like better-sqlite3 on the latest version, 8.1.0, installs just fine with the latest node! Unfortunately, there is no corresponding @types/better-sqlite3 package released yet. The latest one, 7.6.3 doesn't seem to be compatible with node@19 either :/

Maybe, in the meantime, in package.json, we could set the engines node version to be up to node@18 for easier debugging?

What error did you receive?

In terminal after yarn install:

➤ YN0009: │ better-sqlite3@npm:7.6.2 couldn't be built successfully (exit code 1, logs can be found here: /private/var/folders/z0/3vjnzlg16dj160w2gtkbz4n40000gn/T/xfs-be73b5b6/build.log)
➤ YN0000: └ Completed in 7s 532ms
➤ YN0000: Failed with errors in 7s 767ms

In log file:

# This file contains the result of Yarn building a package (better-sqlite3@npm:7.6.2)
# Script name: install

prebuild-install warn install No prebuilt binaries found (target=19.7.0 runtime=node arch=arm64 libc= platform=darwin)

> better-sqlite3@7.6.2 build-release /Users/<my_user>/Documents/code/actual-server/node_modules/better-sqlite3
> node-gyp rebuild --release

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

Traceback (most recent call last):
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 16, in <module>
    sys.exit(gyp.script_main())
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 545, in script_main
    return main(sys.argv[1:])
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 538, in main
    return gyp_main(args)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 523, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2170, in GenerateOutput
    part_of_all=qualified_target in needed_targets)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 766, in Write
    extra_mac_bundle_resources, part_of_all)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 872, in WriteActions
    env = self.GetSortedXcodeEnv()
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 1851, in GetSortedXcodeEnv
    additional_settings)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1584, in GetSortedXcodeEnv
    additional_settings)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1495, in _GetXcodeEnv
    if XcodeVersion() >= '0500' and not env.get('SDKROOT'):
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1265, in XcodeVersion
    version = re.match(r'(\d\.\d\.?\d*)', version).groups()[0]
AttributeError: 'NoneType' object has no attribute 'groups'
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 22.1.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /Users/<my_user>/Documents/code/actual-server/node_modules/better-sqlite3
gyp ERR! node -v v4.4.5
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok 

npm ERR! Darwin 22.1.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build-release"
npm ERR! node v4.4.5
npm ERR! npm  v2.15.5
npm ERR! code ELIFECYCLE
npm ERR! better-sqlite3@7.6.2 build-release: `node-gyp rebuild --release`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the better-sqlite3@7.6.2 build-release script 'node-gyp rebuild --release'.
npm ERR! This is most likely a problem with the better-sqlite3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild --release
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs better-sqlite3
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! 
npm ERR!     npm owner ls better-sqlite3
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/<my_user>/Documents/code/actual-server/node_modules/better-sqlite3/npm-debug.log

Where are you hosting Actual?

Locally via Yarn

What browsers are you seeing the problem on?

Other

Operating System

Mac OSX

Originally created by @0rnella on GitHub (Mar 5, 2023). Original GitHub issue: https://github.com/actualbudget/actual/issues/726 ### Verified issue does not already exist? - [X] I have searched and found no related existing issue for `node 19` or `better-sqlite3` ### What happened? When installing this repo, one dependency could repeatedly not be built: `better-sqlite3`! Eventually, when I realized that fly.io was doing just fine with building the repo, and that they use `node@14`, I downgraded my local node version from `19.7.0` to the latest node@18: `18.14.2`. That did the trick. My diagnosis is that `sql-lite3` version `^7.5.0` is not compatible with node@19. One solution could be to upgrade it: it does look like [better-sqlite3](https://github.com/WiseLibs/better-sqlite3) on the latest version, `8.1.0`, installs just fine with the latest node! Unfortunately, there is no corresponding [@types/better-sqlite3](https://www.npmjs.com/package/@types/better-sqlite3) package released yet. The latest one, `7.6.3` doesn't seem to be compatible with node@19 either :/ Maybe, in the meantime, in package.json, we could set the engines node version to be up to node@18 for easier debugging? ### What error did you receive? In terminal after `yarn install`: ``` ➤ YN0009: │ better-sqlite3@npm:7.6.2 couldn't be built successfully (exit code 1, logs can be found here: /private/var/folders/z0/3vjnzlg16dj160w2gtkbz4n40000gn/T/xfs-be73b5b6/build.log) ➤ YN0000: └ Completed in 7s 532ms ➤ YN0000: Failed with errors in 7s 767ms ``` In log file: ``` # This file contains the result of Yarn building a package (better-sqlite3@npm:7.6.2) # Script name: install prebuild-install warn install No prebuilt binaries found (target=19.7.0 runtime=node arch=arm64 libc= platform=darwin) > better-sqlite3@7.6.2 build-release /Users/<my_user>/Documents/code/actual-server/node_modules/better-sqlite3 > node-gyp rebuild --release xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance Traceback (most recent call last): File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 16, in <module> sys.exit(gyp.script_main()) File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 545, in script_main return main(sys.argv[1:]) File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 538, in main return gyp_main(args) File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 523, in gyp_main generator.GenerateOutput(flat_list, targets, data, params) File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2170, in GenerateOutput part_of_all=qualified_target in needed_targets) File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 766, in Write extra_mac_bundle_resources, part_of_all) File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 872, in WriteActions env = self.GetSortedXcodeEnv() File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 1851, in GetSortedXcodeEnv additional_settings) File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1584, in GetSortedXcodeEnv additional_settings) File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1495, in _GetXcodeEnv if XcodeVersion() >= '0500' and not env.get('SDKROOT'): File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1265, in XcodeVersion version = re.match(r'(\d\.\d\.?\d*)', version).groups()[0] AttributeError: 'NoneType' object has no attribute 'groups' gyp ERR! configure error gyp ERR! stack Error: `gyp` failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16) gyp ERR! stack at emitTwo (events.js:87:13) gyp ERR! stack at ChildProcess.emit (events.js:172:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12) gyp ERR! System Darwin 22.1.0 gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release" gyp ERR! cwd /Users/<my_user>/Documents/code/actual-server/node_modules/better-sqlite3 gyp ERR! node -v v4.4.5 gyp ERR! node-gyp -v v3.3.1 gyp ERR! not ok npm ERR! Darwin 22.1.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build-release" npm ERR! node v4.4.5 npm ERR! npm v2.15.5 npm ERR! code ELIFECYCLE npm ERR! better-sqlite3@7.6.2 build-release: `node-gyp rebuild --release` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the better-sqlite3@7.6.2 build-release script 'node-gyp rebuild --release'. npm ERR! This is most likely a problem with the better-sqlite3 package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild --release npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs better-sqlite3 npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm ERR! npm owner ls better-sqlite3 npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! /Users/<my_user>/Documents/code/actual-server/node_modules/better-sqlite3/npm-debug.log ``` ### Where are you hosting Actual? Locally via Yarn ### What browsers are you seeing the problem on? Other ### Operating System Mac OSX
GiteaMirror added the bug label 2026-04-26 01:29:03 -05:00
Author
Owner

@j-f1 commented on GitHub (Mar 5, 2023):

Maybe, in the meantime, in package.json, we could set the engines node version to be up to node@18 for easier debugging?

That’s a great idea — do you want to open a PR to add that (and maybe a .node-version too?)

That said, are you trying to build this repo or the actual-server repo? I believe this repo is now using v8.1.0 of better-sqlite3.

<!-- gh-comment-id:1455105457 --> @j-f1 commented on GitHub (Mar 5, 2023): > Maybe, in the meantime, in package.json, we could set the engines node version to be up to node@18 for easier debugging? That’s a great idea — do you want to open a PR to add that (and maybe a `.node-version` too?) That said, are you trying to build this repo or the `actual-server` repo? I believe this repo is now using v8.1.0 of better-sqlite3.
Author
Owner

@0rnella commented on GitHub (Mar 6, 2023):

That said, are you trying to build this repo or the actual-server repo? I believe this repo is now using v8.1.0 of better-sqlite3.

Ah, great point! It was both, but I had not pulled actual in a little while. Just saw the upgrade, awesome!

(and maybe a .node-version too?)

I can definitely make this PR on actual-server for the package.json engines node version, but I'm not familiar with this, what's .node-version?

<!-- gh-comment-id:1456533263 --> @0rnella commented on GitHub (Mar 6, 2023): > That said, are you trying to build this repo or the actual-server repo? I believe this repo is now using v8.1.0 of better-sqlite3. Ah, great point! It was both, but I had not pulled `actual` in a little while. Just saw the [upgrade](https://github.com/actualbudget/actual/pull/714), awesome! > (and maybe a .node-version too?) I can definitely make this PR on actual-server for the package.json engines node version, but I'm not familiar with this, what's `.node-version`?
Author
Owner

@j-f1 commented on GitHub (Mar 8, 2023):

I can definitely make this PR on actual-server for the package.json engines node version, but I'm not familiar with this, what's .node-version?

It’s a file used by tools like nvm and others to automatically switch to an appropriate version of Node when entering the project directory.

<!-- gh-comment-id:1459444346 --> @j-f1 commented on GitHub (Mar 8, 2023): > I can definitely make this PR on actual-server for the package.json engines node version, but I'm not familiar with this, what's .node-version? It’s a file used by tools like [nvm](https://github.com/nvm-sh/nvm) and others to automatically switch to an appropriate version of Node when entering the project directory.
Author
Owner

@0rnella commented on GitHub (Mar 8, 2023):

Ah, I have found docs for avn and I think that's what you're talking about.
This would mean installing a new dependency (for me), but more importantly since we're talking about just one out-of-date @types package, I don't think we should be quite so prescriptive about not supporting the latest Node version. Especially with node@14 going out of date in April.
I opened a discussion to upgrade the @types package, will keep an eye on it!
Also, opened this issue in actual-server instead: https://github.com/actualbudget/actual-server/issues/151

<!-- gh-comment-id:1459806822 --> @0rnella commented on GitHub (Mar 8, 2023): Ah, I have found docs for [avn](https://github.com/wbyoung/avn) and I think that's what you're talking about. This would mean installing a new dependency (for me), but more importantly since we're talking about just one out-of-date @types package, I don't think we should be quite so prescriptive about not supporting the latest Node version. Especially with node@14 going out of date in April. I opened a [discussion to upgrade the @types package](https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/64626), will keep an eye on it! Also, opened this issue in actual-server instead: https://github.com/actualbudget/actual-server/issues/151
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#41947