Build from Source
Clone the repository and build Daintree from source.
Prerequisites
Building Daintree needs four things:
- Git v2.30+
- Node.js v22.12.0+: the exact version is pinned in
.node-versionand.nvmrc. Use nvm or fnm to match it. - npm: ships with Node.js.
- Platform build tools: needed to compile the native
node-ptymodule (see below).
Install the Xcode Command Line Tools if you don't have them:
xcode-select --installInstall the Visual Studio Build Tools with the Desktop development with C++ workload. The quickest route is npm:
npm install -g windows-build-toolsInstall the C/C++ toolchain and the libraries it needs:
sudo apt install build-essential python3 libx11-dev libxkbfile-devClone & Install
git clone https://github.com/daintreehq/daintree.git
cd daintree
npm install The postinstall script rebuilds the native modules (node-pty and better-sqlite3) against the Electron runtime. If it fails, run npm run rebuild yourself.
Development
Start the dev server with hot reload:
npm run dev This runs the Vite renderer dev server and the Electron main process together. Renderer changes hot-reload right away. Main-process changes trigger an automatic restart.
Production Build
Build the app without packaging it:
npm run build This compiles the renderer with Vite into dist/ and the main process with ESBuild into dist-electron/.
Run the Built App
Once it's built, you can launch Daintree directly. No installer needed:
npx electron . This reads the "main" field in package.json to find the compiled entry point at dist-electron/electron/main.js. It's the quickest way to test a production build locally.
electron is already a devDependency, so npx uses the locally installed copy. Nothing extra to download.Package for Distribution
Build platform-specific installers:
npm run package:mac Writes a DMG and ZIP to the release/ directory. The binary is universal, so it runs on Intel and Apple Silicon.
npm run package:win Writes an NSIS installer and a portable executable to the release/ directory.
npm run package:linux Writes an AppImage and a .deb package to the release/ directory.
npm run package does the same thing and picks the target for your current platform.
Troubleshooting
node-pty build failures
If npm install fails on the native module rebuild:
- Check that the platform build tools are installed (see Prerequisites above).
- Rebuild by hand:
npm run rebuild - On macOS, confirm the Xcode CLI tools are current:
xcode-select --install
Wrong Node.js version
Daintree needs Node.js 22.12.0+. If you see a version error, switch to it:
nvm install # reads .nvmrc automatically
nvm use