Originally created by: adityaharishch
Problem
The bootstrap installer requires Node.js to be present on the user's machine (for npm install -g and to run the Next.js UI + MCP server at runtime). On a fresh macOS install, this means installing Homebrew → Node before Meridian can be used.
Proposed solution
Bundle the official node darwin-arm64 binary inside the npm package so users need zero prerequisites beyond Homebrew (for the initial npm install -g). Eventually Homebrew itself could be removed from the critical path too.
Changes needed:
npm/meridian-darwin-arm64/bin/ — add pinned node (and npm) binary from the official Node.js darwin-arm64 tarball
scripts/install-ui-daemon.sh — use $APP_DIR/bin/node instead of system node to serve .next/standalone/server.js
packages/meridian-mcp/ launch — use bundled node for dist/index.js
scripts/meridian-cli.sh — audit all node/npm/npx callsites and route to bundled binary where appropriate
scripts/bootstrap.sh — remove the Node.js installation step
package-release.sh — include the node binary in the release bundle
Key risks to handle
- ABI mismatch —
better-sqlite3 is a native addon compiled against a specific Node ABI. The bundled Node version must match the ABI used to build better-sqlite3 in CI. Check with node -p "process.versions.modules" on the build machine and pin accordingly.
meridian update — currently calls npm install -g; needs to use the bundled npm or be rewritten.
- Dev workflow unchanged — developers cloning the repo still use system Node for
npm run dev; the bundled binary is only for the installed package.
Notes
output: 'standalone' is already configured in next.config.ts — the UI already runs with node server.js, no next CLI needed at runtime.
- Node darwin-arm64 binary is ~35 MB compressed — acceptable package size increase.
npm is included in the official Node tarball, so bundling both node + npm from the same tarball is straightforward.