bach.exe, the command you run, and bach-setup.exe, the installer window every setup file is built from. Pick the install method that fits your machine. None of them needs Rust, and none asks for administrator rights unless you ask for a system-wide install.
- npm
- Windows (PowerShell)
- macOS and Linux
- Scoop
- Zip download
- cargo
- GitHub Action
With Node.js 18 or newer, on Windows, macOS and Linux:The package holds no program of its own. npm installs the matching
@usebach/cli-<platform> package next to it, and bach starts that. No install script runs and nothing is downloaded afterwards, so it works with --ignore-scripts. On Windows the platform package also carries bach-setup.exe.- In one project:
npm install --save-dev @usebach/cli, thennpx bach build. - Update:
npm update --global @usebach/cli. - Remove:
npm uninstall --global @usebach/cli.
Do not use
sudo or an elevated shell. If npm’s global folder is not writable, point npm at your own with npm config set prefix ~/.npm-global. If bach reports that its platform package isn’t installed, npm ran with --omit=optional: install again without that flag.Keep bach up to date
When a newer release exists,bach says so at the end of a command run in a terminal. Run bach update to install it. That works for the PowerShell and shell scripts and for the zip download; a bach installed with npm, Scoop, winget or cargo is updated with that tool, and bach update names the command. See bach update.
Check the install
bach doctor says whether the runtime, the config and the optional tools are in place, and exactly what to fix if not. See bach doctor.
Where Bach finds its runtime
Every installer is built onbach-setup.exe. When you run bach build or bach preview, bach looks for it in this order:
- The path given with
--runtime, or in theBACH_RUNTIMEenvironment variable. - The file next to
bachitself. - In a checkout of the Bach repository, the copy a
cargo buildleft intarget\releaseortarget\debug. - A copy downloaded earlier. The cache is
%LOCALAPPDATA%\bach\runtime\<version>on Windows, and$XDG_CACHE_HOME/bach/runtime/<version>(or~/.cache/...) elsewhere. - The one published with this version of Bach on GitHub, downloaded once and checked against its SHA-256 before use.
BACH_NO_DOWNLOAD to forbid the last step. All environment variables are listed in Environment variables.
Build from source
With Rust (stable) and the Visual Studio C++ build tools:target\release\bach.exe and target\release\bach-setup.exe.
Next step
Quickstart
Write your first bach.toml and build a Setup.exe.