Hmbown/CodeWhale · error

cannot locate the installed dsh package root from {}

Error message

cannot locate the installed dsh package root from {}

What it means

`app_bundle_source` resolves the installed launcher's package root from the `dsh` binary path via `launcher_package_root` (bundle.rs:148-168): it canonicalizes the binary (resolving the npm bin shim symlink to `lib/bin.js`), walks up at most four parents looking for a package.json containing `"@deepseek-ai/dsh"`, then falls back to a sibling `node_modules/@deepseek-ai/dsh` for Windows .cmd/.ps1 shims. This error means neither strategy found the package root — the install layout is not one Codewhale recognizes.

Source

Thrown at crates/tui/src/integrations/dsh/bundle.rs:181

        .parent()?
        .join("node_modules")
        .join("@deepseek-ai")
        .join("dsh");
    is_dsh_package_root(&sibling).then_some(sibling)
}

fn is_dsh_package_root(dir: &Path) -> bool {
    dir.join("package.json").is_file()
        && std::fs::read_to_string(dir.join("package.json"))
            .ok()
            .is_some_and(|text| text.contains("\"@deepseek-ai/dsh\""))
}

/// The shipped app bundle directory inside the installed launcher, if it
/// declares `dsh.bundle.patch`.
pub(crate) fn app_bundle_source(binary: &Path, app: DshAppBundle) -> Result<PathBuf> {
    let root = launcher_package_root(binary).ok_or_else(|| {
        anyhow::anyhow!(
            "cannot locate the installed dsh package root from {}",
            binary.display()
        )
    })?;
    let dir = root.join("node_modules").join(app.package_name());
    let manifest = std::fs::read_to_string(dir.join("package.json"))
        .with_context(|| format!("read {}", dir.join("package.json").display()))?;
    if !manifest.contains("\"bundle\"") || !manifest.contains("\"patch\"") {
        anyhow::bail!(
            "{} does not declare dsh.bundle.patch; cannot link it as a profile bundle",
            dir.display()
        );
    }
    Ok(dir)
}

pub(crate) fn bundle_version(codewhale_version: &str, patch_sha256: &str) -> String {
    format!(

View on GitHub (pinned to 8880682c63)

Solutions

  1. Reinstall dsh with npm so the layout matches what the resolver walks: `npm i -g @deepseek-ai/dsh`
  2. Inspect what the binary resolves to: `readlink -f "$(which dsh)"` — it should land inside `…/@deepseek-ai/dsh/lib/` or a prefix whose node_modules holds the package
  3. If you use pnpm/bun globally, install dsh via npm only for this integration to work
  4. After reinstalling, verify with `codewhale integrations dsh status` then retry install-bundle
Defensive patterns

Strategy: validation

Validate before calling

let detection = detect_now();
if let Some(binary) = &detection.binary {
    if dsh::bundle::launcher_package_root(binary).is_none() {
        eprintln!("unrecognized dsh install layout; reinstall with npm: npm i -g @deepseek-ai/dsh");
        return Ok(());
    }
}

Type guard

fn package_root_known(binary: &std::path::Path) -> bool {
    dsh::bundle::launcher_package_root(binary).is_some()
}

Prevention

When it happens

Trigger: install-bundle when dsh was installed by a package manager whose bin shims do not live inside or beside the package: pnpm global installs (shims point into a content-addressable store), bun, volta, or a wrapper script in ~/bin; also a manually moved binary or an npm prefix whose node_modules was pruned.

Common situations: `pnpm add -g @deepseek-ai/dsh` instead of npm; volta-managed shims; npx-style ephemeral installs; Windows wrappers not covered by the sibling fallback; symlinks whose canonicalize fails (broken link, permission).

Related errors


AI-assisted analysis of Hmbown/CodeWhale@8880682c63 (2026-08-16). Data as JSON: /api/errors/4f420f7502a39030. Report an issue: GitHub.