Request: Update better-sqlite3 to support Node.js 24
Problem
Soul-cli currently depends on better-sqlite3: ^8.1.0, which does not support Node.js 24. This prevents applications using soul-cli from upgrading to Node.js 24, which is now the current release.
Current situation:
- soul-cli versions 0.7.8 and 0.8.2 both require
better-sqlite3: ^8.1.0 - better-sqlite3 v8.x supports Node.js 14.x through 20.x
- Node.js 24 requires better-sqlite3 v12.0.0 or later
Error when trying to run on Node.js 24: Applications crash or fail to start because better-sqlite3 v8.x native modules cannot load on Node.js 24.
Solution
Update the dependency in soul-cli's package.json:
{
"dependencies": {
"better-sqlite3": "^12.4.1"
}
}
better-sqlite3 Version Compatibility
- v8.x: Supports Node.js 14.x - 20.x
- v12.0.0: Added Node.js 24 support (but had missing prebuild binaries)
- v12.1.0+: Full Node.js 24 support with complete prebuild binaries
- v12.4.1 (current): Supports Node.js 20.x, 22.x, 23.x, and 24.x
Breaking Changes Assessment
The better-sqlite3 API is stable between v8.x and v12.x. The main breaking change in v12.0.0 was:
- Dropped Node.js 18 support
- Added Node.js 24 support
No API changes that should affect soul-cli's usage. The upgrade should be straightforward.
Benefits
- Node.js 24 support: Enables applications to use the latest Node.js version
- Future-proofing: Node.js 20 reaches EOL in April 2026
- Performance: Access to Node.js 24 performance improvements
- Security: Latest Node.js security updates
- Ecosystem alignment: Keeps soul-cli compatible with modern Node.js versions
Testing Checklist
Before merging, the following should be tested:
- [ ] Database connection and initialization
- [ ] CRUD operations (CREATE, READ, UPDATE, DELETE)
- [ ] Transaction support
- [ ] Custom SQL queries
- [ ] Authentication/authorization functionality
- [ ] WebSocket/realtime features
- [ ] All existing soul-cli features continue to work
- [ ] Test on Node.js 20, 22, and 24
Workaround for Users
Until this is merged, users can work around this by using yarn resolutions:
{
"resolutions": {
"better-sqlite3": "^12.4.1"
}
}
However, this is not officially supported and requires extensive testing.
Additional Context
- Node.js 24 was released in October 2024
- better-sqlite3 v12.1.0 with full Node.js 24 support was released in November 2024
- This affects all soul-cli users wanting to adopt Node.js 24
Proposed PR
I'm willing to submit a pull request for this change if you're open to it. The change should be minimal - just updating the dependency version and running tests to confirm compatibility.
References:
Thanks, Ian! Iām okay with you taking this on ā feel free to open the PR whenever ready.
Thanks, Ian! Iām okay with you taking this on ā feel free to open the PR whenever ready.
Thanks Vahid, PR here: https://github.com/thevahidal/soul/pull/230
Thanks, Ian! Iām okay with you taking this on ā feel free to open the PR whenever ready.
Thanks Vahid, PR here: #230
Hey @IanMayo, thanks for the PR. Sorry I didn't respond earlier, I was on a trip. I left a comment on your PR, you need to bump Soul version.
you need to bump Soul version.
Got it, thanks. On my dev machine I need to apply some fixes to get the unit tests working. I'll produce a PR (https://github.com/thevahidal/soul/pull/232) for that, branching off main, and will then re-apply these changes to the fixed main (bumping version in both).