Index: compiler-cli/src/beam_compiler.rs
--- compiler-cli/src/beam_compiler.rs.orig
+++ compiler-cli/src/beam_compiler.rs
@@ -1,8 +1,7 @@
 use gleam_core::{
-    Result,
     error::{Error, ShellCommandFailureReason},
     io::{FileSystemWriter, Stdio},
-    paths,
+    paths, Result,
 };
 
 use crate::fs::get_os;
@@ -59,7 +58,7 @@ impl BeamCompiler {
         tracing::debug!(args=?args, "call_beam_compiler");
 
         writeln!(inner.stdin, "{args}.").map_err(|e| Error::ShellCommand {
-            program: "escript".into(),
+            program: "escript${MODERL_VERSION}".into(),
             reason: ShellCommandFailureReason::IoError(e.kind()),
         })?;
 
@@ -73,7 +72,7 @@ impl BeamCompiler {
                 }
                 "gleam-compile-result-error" => {
                     return Err(Error::ShellCommand {
-                        program: "escript".into(),
+                        program: "escript${MODERL_VERSION}".into(),
                         reason: ShellCommandFailureReason::Unknown,
                     });
                 }
@@ -93,7 +92,7 @@ impl BeamCompiler {
 
         // if we get here, stdout got closed before we got an "ok" or "err".
         Err(Error::ShellCommand {
-            program: "escript".into(),
+            program: "escript${MODERL_VERSION}".into(),
             reason: ShellCommandFailureReason::Unknown,
         })
     }
@@ -112,18 +111,18 @@ impl BeamCompiler {
 
         tracing::trace!(escript_path=?escript_path, "spawn_beam_compiler");
 
-        let mut process = std::process::Command::new("escript")
+        let mut process = std::process::Command::new("escript${MODERL_VERSION}")
             .arg(escript_path)
             .stdin(std::process::Stdio::piped())
             .stdout(std::process::Stdio::piped())
             .spawn()
             .map_err(|e| match e.kind() {
                 io::ErrorKind::NotFound => Error::ShellProgramNotFound {
-                    program: "escript".into(),
+                    program: "escript${MODERL_VERSION}".into(),
                     os: get_os(),
                 },
                 other => Error::ShellCommand {
-                    program: "escript".into(),
+                    program: "escript${MODERL_VERSION}".into(),
                     reason: ShellCommandFailureReason::IoError(other),
                 },
             })?;
