Describe the bug
When omniroute is installed globally via npm install -g omniroute on macOS, and the active Node.js version is subsequently updated or differs from the installation version (e.g., updating to Node v26.3.0 which uses NODE_MODULE_VERSION 147), the better-sqlite3 native module fails to load because it was compiled against a different version (e.g., NODE_MODULE_VERSION 127).
While OmniRoute gracefully detects this incompatibility and outputs a troubleshooting message:
✖ better-sqlite3 native module is incompatible with this platform.
Run: cd /opt/homebrew/lib/node_modules/omniroute/dist && npm rebuild better-sqlite3
This failure causes background launchd services (such as com.rvs.omniroute.plist system/user daemons) to fail to start and crash repeatedly (exiting with code 1), making it hard to diagnose without manually reading logs or running the command directly in the shell.
To Reproduce
- Install
omniroute globally using Node 22: npm install -g omniroute
- Update/switch Node version to v26.3.0.
- Start the service (or run
omniroute).
- See dlopen failure warning and process exit code 1.
Possible Solutions / Suggestions
- Self-Healing / Auto-Rebuild: If the CLI detects
!isNativeBinaryCompatible(sqliteBinary) and the environment has write permissions to the directory, trigger/prompt npm rebuild better-sqlite3 automatically, or add a recovery command like omniroute repair.
- Launchd Troubleshooting / Documentation: Add notes in the documentation about running
npm rebuild better-sqlite3 when Node is updated.
Describe the bug
When
omnirouteis installed globally vianpm install -g omnirouteon macOS, and the active Node.js version is subsequently updated or differs from the installation version (e.g., updating to Node v26.3.0 which usesNODE_MODULE_VERSION 147), thebetter-sqlite3native module fails to load because it was compiled against a different version (e.g.,NODE_MODULE_VERSION 127).While OmniRoute gracefully detects this incompatibility and outputs a troubleshooting message:
This failure causes background launchd services (such as
com.rvs.omniroute.plistsystem/user daemons) to fail to start and crash repeatedly (exiting with code 1), making it hard to diagnose without manually reading logs or running the command directly in the shell.To Reproduce
omnirouteglobally using Node 22:npm install -g omnirouteomniroute).Possible Solutions / Suggestions
!isNativeBinaryCompatible(sqliteBinary)and the environment has write permissions to the directory, trigger/promptnpm rebuild better-sqlite3automatically, or add a recovery command likeomniroute repair.npm rebuild better-sqlite3when Node is updated.