jdx/mise · error · RuntimeError
cannot install #{src}: does not exist
Error message
cannot install #{src}: does not exist What it means
install_one is a private helper in the brew shim that moves a built file from its source path to the install destination. It raises when the source path neither exists nor is a symlink, meaning the formula's build stage never produced the artifact the install step expects to move.
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 afd2eddd3a)
Solutions
- Verify the source path exists in the stage directory before install (ls the stage dir)
- Check the formula's install blocks reference the actual built artifact names
- Re-run the build step and confirm it succeeds before install
- Ensure the stage directory wasn't cleaned between build and install
Example fix
# before
install_one "#{buildpath}/bin/mytool", bin
# after
binary = "#{buildpath}/bin/mytool"
raise "build did not produce #{binary}" unless File.exist?(binary)
install_one binary, bin Defensive patterns
Strategy: validation
Validate before calling
raise "missing install source" unless File.exist?(src) || File.symlink?(src)
Prevention
- Check the stage directory contains the expected artifact before installing
- Match install paths exactly to what the build system emits
- Fail the build step loudly instead of letting install find nothing
When it happens
Trigger: Calling install (or install_symlink) with a src path that was never created by the build step — e.g. the binary name in the formula doesn't match what the build system actually produced, or the build silently failed earlier.
Common situations: Formulae pinned to old versions where upstream renamed the output binary; build systems writing artifacts to a different directory (build/ vs release/); partially cleaned stage directories after an interrupted install.
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
- Ruby engine '{}' is not supported on Windows. Only standard
- no precompiled ruby found for {tv} on {platform}
- no precompiled ruby is available for this platform
- {}@{requested} is not installed{resolved} hint: run `mise in
- no precompiled ruby is available for this platform To compil
AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09).
Data as JSON: /api/errors/772c7fa249bc1231.
Report an issue: GitHub.