Run the installer script to download the latest release, verify its checksum, and set up your PATH:
curl -fsSL https://raw.githubusercontent.com/StackMade/driftr/main/install.sh | shThe script:
- Detects your OS and architecture
- Downloads the latest binary from GitHub Releases
- Verifies the SHA256 checksum
- Installs to
~/.driftr/bin/ - Runs
driftr setupto create directories and shims - Adds
~/.driftr/binto your PATH
Pin a specific version:
DRIFTR_VERSION=0.1.0 curl -fsSL https://raw.githubusercontent.com/StackMade/driftr/main/install.sh | shOverride the install directory:
DRIFTR_INSTALL_DIR=/usr/local/bin curl -fsSL https://raw.githubusercontent.com/StackMade/driftr/main/install.sh | shwget -qO- https://raw.githubusercontent.com/StackMade/driftr/main/install.sh | shbrew tap StackMade/driftr
brew install driftrHomebrew places the driftr binary in /opt/homebrew/bin/driftr (Apple Silicon) or /usr/local/bin/driftr (Intel). Two additional steps are required before Driftr works:
Step 1 — Create shims and data directories:
driftr setupStep 2 — Configure PATH ordering:
Driftr's shims (node, npm, pnpm, yarn) live in ~/.driftr/bin/. For version pinning to work, this directory must appear before Homebrew paths in PATH.
On macOS, /usr/libexec/path_helper runs at login shell startup (often together with brew shellenv in ~/.zprofile) and pushes /opt/homebrew/bin to the front, which causes Homebrew's system node (if installed) to shadow Driftr's shims. To fix this, add the PATH export to a file sourced after path_helper:
Zsh — add to both ~/.zshenv (covers scripts, cron, IDE terminals) and ~/.zshrc (sourced last in interactive sessions, so the shim dir wins over path_helper):
echo 'export PATH="$HOME/.driftr/bin:$PATH"' >> ~/.zshenv
echo 'export PATH="$HOME/.driftr/bin:$PATH"' >> ~/.zshrcBash — add to ~/.bash_profile:
echo 'export PATH="$HOME/.driftr/bin:$PATH"' >> ~/.bash_profileOr let Driftr do it for you: driftr setup and driftr doctor --fix both configure the universal file and, when they detect that another install (Homebrew, Volta, …) is shadowing the shims, append a PATH precedence guard to your interactive rc (~/.zshrc, ~/.bashrc, or fish config.fish) so the shims win. Run driftr doctor to verify your setup.
brew upgrade driftrbrew uninstall driftr
rm -rf ~/.driftrDriftr is written in Go. You need Go 1.26 or later to build it.
- Go 1.26+
- Git
- macOS or Linux (Windows support is planned)
git clone https://github.com/StackMade/driftr.git
cd driftr
go build -o driftr ./cmd/driftr/Move the binary to a directory in your PATH:
sudo mv driftr /usr/local/bin/Or install it directly with Go:
go install github.com/stackmade/driftr/cmd/driftr@latestAfter installing the binary, run setup to create directories and shim scripts:
driftr setupThis creates the following structure:
~/.driftr/
bin/ shim scripts (node, npm, npx, pnpm, pnpx, yarn, bun)
tools/ installed tool versions
config/ global configuration
cache/ downloaded archives + binaries
Add the shim directory to the beginning of your PATH so Driftr's shims take priority over any system-installed Node.js.
echo 'export PATH="$HOME/.driftr/bin:$PATH"' >> ~/.zshenv.zshenv is sourced by every zsh invocation — interactive shells, scripts, cron, and IDE
terminals — and is the primary location. On its own it is not enough for interactive
shells on macOS, though:
macOS note: Login shells invoke
/usr/libexec/path_helper, which reorders PATH and pushes Homebrew (/opt/homebrew/bin) to the front. To guarantee Driftr wins, also add the export to~/.zshrc(sourced last in interactive sessions). This matches whatinstall.shanddriftr doctor --fixconfigure automatically:echo 'export PATH="$HOME/.driftr/bin:$PATH"' >> ~/.zshrcSee the Homebrew section above for a detailed explanation.
echo 'export PATH="$HOME/.driftr/bin:$PATH"' >> ~/.bash_profileecho 'set -gx PATH $HOME/.driftr/bin $PATH' >> ~/.config/fish/conf.d/driftr.fishOr let driftr doctor --fix handle it automatically.
Then reload your shell:
source ~/.zshenv # zsh
# or source ~/.bash_profile for bashTip: Run driftr doctor to verify PATH is configured correctly. driftr doctor --fix
adds a PATH export to the correct target file and regenerates broken shims. Stale entries in
old rc files are flagged but not removed, so clean those up by hand.
which node
# Should output: /Users/<you>/.driftr/bin/node
driftr --help
# Should show the Driftr help menuDriftr can also be tested in a Docker container without affecting your local environment.
docker build -t driftr .docker run --rm driftr install node@22
docker run --rm driftr listgo test ./...To remove Driftr:
-
Remove the binary:
rm /usr/local/bin/driftr
-
Remove Driftr data:
rm -rf ~/.driftr -
Remove the
PATHentry from your shell profile.