jdx/mise · error · eyre::Report

mas app IDs must be numeric ADAM IDs (e.g. "mas:497799835")

Error message

mas app IDs must be numeric ADAM IDs (e.g. "mas:497799835")

What it means

validate_package_name checks the `mas` (Mac App Store) manager specially: package names must be numeric ADAM IDs such as 497799835. The given name is not numeric (possibly an app name), so the spec is rejected before any mas invocation.

Solutions

  1. Look up the app's numeric ADAM ID (e.g. via the App Store URL or a search tool) and use it: mas:497799835
  2. Remove non-numeric characters from the mas package name
  3. Switch to a different manager (brew) if you need name-based installs

Example fix

// before
packages = ["mas:xcode"]
// after
packages = ["mas:497799835"]
Defensive patterns

Strategy: validation

Validate before calling

const isAdamId = (name) => /^\d+$/.test(name);

Type guard

const isAdamId = (name) => typeof name === "string" && /^\d+$/.test(name);

Prevention

When it happens

Trigger: Calling bootstrap packages with a mas spec whose package name fails packages::mas::is_adam_id, e.g. 'mas:xcode' or 'mas:497799835@latest' handled elsewhere.

Common situations: Using an app name instead of its ADAM ID in bootstrap packages config; copying an App Store URL slug; mistyping digits (letters in the ID).

Understand the failure class

Background: "invalid id" errors: invalid identifier format — why libraries reject IDs before lookup, and how to fix them — this error's family across 37 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/3c700b084417e19c. Report an issue: GitHub.

Appendix: source

Thrown at src/system/mod.rs:1884

fn normalize_use_spec_package_name<'a>(mgr: &str, name: &'a str) -> eyre::Result<&'a str> {
    if mgr == "mas"
        && let Some(name) = name.strip_suffix("@latest")
    {
        if name.is_empty() {
            bail!("invalid system package spec: expected '<manager>:<package>[@version]'");
        }
        return Ok(name);
    }
    Ok(name)
}

fn validate_package_name(mgr: &str, name: &str) -> eyre::Result<()> {
    if mgr == "nix" {
        packages::nix::Installable::parse(name)?;
    }
    if mgr == "mas" && !packages::mas::is_adam_id(name) {
        bail!("mas app IDs must be numeric ADAM IDs (e.g. \"mas:497799835\")");
    }
    Ok(())
}

/// Collect export declarations before manager validation can warn and skip an
/// invalid entry. Export must either represent the entire selection or fail.
pub(crate) fn nix_packages_for_export(config: &Config) -> Vec<(String, PackageTomlConfig)> {
    let environments = &crate::env::MISE_ENV_WITH_AUTO;
    package_configs_from_config_files(&config.config_files)
        .into_iter()
        .filter(|(spec, package)| {
            spec.starts_with("nix:")
                && package.is_os_supported()
                && package.is_env_supported(environments)
                && package.desired() == packages::PackageDesiredState::Present
        })
        .collect()
}

View on GitHub (pinned to 533346cc37)