Skip to content

Require a Node.js whose SQLite has full-text search; make the built CLI executable - #16

Merged
deemonic merged 1 commit into
mainfrom
node-fts5-and-bin
Nov 13, 2026
Merged

deemonic merged 1 commit into
mainfrom
node-fts5-and-bin

Conversation

@deemonic

Copy link
Copy Markdown
Contributor

Fixes the two bugs found while publishing 0.0.1.

1. Search needs SQLite FTS5, and some supported Node versions lack it

Cause. Node only bundles SQLite with FTS5 from 22.16.0 in the 22 line and from 24.0.0. It came with nodejs/node#57621, "sqlite: enable common flags", which is in the v22 and v24 changelogs. No Node 23 release has it. So Homebrew's node 23.11.0 fails search with no such module: fts5, and engines: >=22.13 allowed it. Node builds that link the system's SQLite can also lack FTS5, whatever their version.

Fix:

  • engines is now ^22.16.0 || >=24.
  • One rule, src/util/node-support.ts, drives the CLI's start-up check, wheems service install and doctor. Its message names the versions that work, for example: "Node.js 23.11.0 can't run Wheems: no Node 23 release has SQLite full-text search, which Wheems's search needs. Use Node.js 22.16 or later in the 22 line, or 24 or later."
  • Doctor gets a new SQLite search check that creates an FTS5 table, which catches builds with a system SQLite that lacks it.
  • Search checks the same before opening an index, and fails with that plain message instead of an SQLite error.
  • No fallback search. It would be a second, slower keyword search to maintain only for Node builds outside the supported range.

Node versions checked on this Mac:

Node SQLite FTS5 Wheems
23.11.0 (Homebrew node, bundled SQLite) 3.49.1 no refused with the message above; the probe names no such module: fts5
21.7.3 no node:sqlite – refused: too old
22.23.2 (bundled SQLite) 3.51.3 yes runs
22.23.4 (bundled SQLite) 3.53.4 yes runs; doctor passes the new check
22.23.4 (Homebrew node@22, Homebrew's SQLite) 3.54.1 yes runs

The 22.16 and 24.0 boundaries come from Node's changelogs. They were not run here.

2. The built CLI wasn't executable

tsc writes dist/cli/main.js without the executable bit, so a wheems linked with npm link failed with "Permission denied". npm run build now runs scripts/make-executable.ts after tsc, which marks every bin entry executable.

Tests

  • Version boundaries.
  • The FTS5 probe, both real and with a stand-in that has no FTS5.
  • Doctor on Node 23, and on a Node without FTS5.
  • Search refusing sync, rebuild and search with the plain message.
  • Marking bin entries executable, and the build and engines wiring.

npm run check passes: 371 tests. Vasquez passed with no findings.

Docs updated: README, getting started, and the changelog (under Unreleased).

🤖 Generated with Claude Code

…lt CLI executable

Search needs SQLite's FTS5. Node bundles SQLite with it only from 22.16.0 in
the 22 line and from 24.0.0 (nodejs/node#57621); no Node 23 release has it, so
Homebrew's node 23.11 failed 21 search tests with "no such module: fts5".

- engines is now ^22.16.0 || >=24, and one rule (src/util/node-support.ts)
  drives the CLI's start-up check, `wheems service install` and doctor, with a
  message naming the versions that work.
- Doctor checks that this Node's SQLite can create an FTS5 table, since builds
  that use the system's SQLite can lack it whatever their version.
- Search checks the same before opening an index and says so plainly instead
  of failing inside SQLite. No fallback search: a second keyword search for
  unsupported Node builds isn't worth keeping.

The build now runs scripts/make-executable.ts after tsc, marking every bin
executable, so `npm link`ed wheems runs instead of "Permission denied".

Checked by hand on Node 23.11.0 (refused, no FTS5), 21.7.3 (refused, too old)
and 22.23.2 / 22.23.4 (FTS5 present, runs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@deemonic
deemonic merged commit 6680fba into main Nov 13, 2026
2 checks passed
@deemonic
deemonic deleted the node-fts5-and-bin branch November 15, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant