jdx/mise · error · RuntimeError
cannot install # : does not exist
Error message
cannot install #{src}: does not exist What it means
The brew shim's `install_one` moves a built source file or symlink into its destination during formula installation. It raises when the source path neither exists nor is a symlink, meaning the build/stage step failed to produce the expected artifact before the move.
Solutions
- Check the formula's install block and confirm the src path matches the actual staged artifact layout (ls the stage dir).
- Verify the download/unpack step succeeded and the archive contains the expected files (checksum and archive structure).
- If upstream moved the artifact, update the formula path to the new location.
- Wrap the build in verbose mode to see which step failed to produce the file before the move.
Example fix
# before
install_one "bin/#{name}-old", bin
# after
install_one "bin/#{name}", bin # upstream renamed the binary Defensive patterns
Strategy: validation
Validate before calling
src = Pathname.new(candidate)
raise "staged artifact missing: #{src}" unless src.exist? || src.symlink?
install_one(src, dest) Try / catch
begin
install_one(src, dest)
rescue RuntimeError => e
raise unless e.message.start_with?("cannot install")
# inspect stage dir, re-run or fail install
end Prevention
- After build steps, assert expected artifacts exist before install
- Diff staged file layout against the formula's assumptions on version bumps
- Run installs with verbose output to catch silent build failures
When it happens
Trigger: Calling install (which fans out to install_one) with a src path that was never created — e.g. the unpacked archive layout differs from what the formula's install block expects, a build step silently skipped writing the binary, or an incorrect path string is passed.
Common situations: Upstream renamed or relocated the binary between releases so the formula copies from a stale path; a partially failed download produced an empty stage directory; typos in the install block's path handling inside a Homebrew formula running under mise's brew shim.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
- command failed: #
- completion generation failed: #
- # : malformed sha256
- # : missing sha256
- failed to decompress #
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/772c7fa249bc1231.
Report an issue: GitHub.
Appendix: source
Thrown at src/system/packages/brew/shim.rb:239
end
# Pathname extensions mirroring brew's
class Pathname
def install(*sources)
mkpath
sources.flatten.each do |src|
case src
when Hash
src.each { |from, to| install_one(from, self + to) }
else
install_one(src, self + Pathname.new(src.to_s).basename)
end
end
end
def install_one(src, dest)
src = Pathname.new(src.to_s)
raise "cannot install #{src}: does not exist" unless src.exist? || src.symlink?
dest.dirname.mkpath
FileUtils.mv src.to_s, dest.to_s
end
private :install_one
def install_symlink(*sources)
mkpath
sources.flatten.each do |src|
case src
when Hash
src.each { |from, to| make_relative_symlink(Pathname.new(from.to_s), self + to) }
else
src = Pathname.new(src.to_s)
make_relative_symlink(src, self + src.basename)
end
end
end
View on GitHub (pinned to 533346cc37)