{"record":{"id":"4f420f7502a39030","repo":"Hmbown/CodeWhale","slug":"cannot-locate-the-installed-dsh-package-root-from","errorCode":null,"errorMessage":"cannot locate the installed dsh package root from {}","messagePattern":"cannot locate the installed dsh package root from (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/integrations/dsh/bundle.rs","lineNumber":181,"sourceCode":"        .parent()?\n        .join(\"node_modules\")\n        .join(\"@deepseek-ai\")\n        .join(\"dsh\");\n    is_dsh_package_root(&sibling).then_some(sibling)\n}\n\nfn is_dsh_package_root(dir: &Path) -> bool {\n    dir.join(\"package.json\").is_file()\n        && std::fs::read_to_string(dir.join(\"package.json\"))\n            .ok()\n            .is_some_and(|text| text.contains(\"\\\"@deepseek-ai/dsh\\\"\"))\n}\n\n/// The shipped app bundle directory inside the installed launcher, if it\n/// declares `dsh.bundle.patch`.\npub(crate) fn app_bundle_source(binary: &Path, app: DshAppBundle) -> Result<PathBuf> {\n    let root = launcher_package_root(binary).ok_or_else(|| {\n        anyhow::anyhow!(\n            \"cannot locate the installed dsh package root from {}\",\n            binary.display()\n        )\n    })?;\n    let dir = root.join(\"node_modules\").join(app.package_name());\n    let manifest = std::fs::read_to_string(dir.join(\"package.json\"))\n        .with_context(|| format!(\"read {}\", dir.join(\"package.json\").display()))?;\n    if !manifest.contains(\"\\\"bundle\\\"\") || !manifest.contains(\"\\\"patch\\\"\") {\n        anyhow::bail!(\n            \"{} does not declare dsh.bundle.patch; cannot link it as a profile bundle\",\n            dir.display()\n        );\n    }\n    Ok(dir)\n}\n\npub(crate) fn bundle_version(codewhale_version: &str, patch_sha256: &str) -> String {\n    format!(","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/tui/src/integrations/dsh/bundle.rs#L163-L199","documentation":"`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.","triggerScenarios":"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.","commonSituations":"`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).","solutions":["Reinstall dsh with npm so the layout matches what the resolver walks: `npm i -g @deepseek-ai/dsh`","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","If you use pnpm/bun globally, install dsh via npm only for this integration to work","After reinstalling, verify with `codewhale integrations dsh status` then retry install-bundle"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let detection = detect_now();\nif let Some(binary) = &detection.binary {\n    if dsh::bundle::launcher_package_root(binary).is_none() {\n        eprintln!(\"unrecognized dsh install layout; reinstall with npm: npm i -g @deepseek-ai/dsh\");\n        return Ok(());\n    }\n}","typeGuard":"fn package_root_known(binary: &std::path::Path) -> bool {\n    dsh::bundle::launcher_package_root(binary).is_some()\n}","tryCatchPattern":null,"preventionTips":["Install dsh via npm globally — the resolver is built for npm's bin-shim layout","After changing package managers, verify `readlink -f \"$(which dsh)\"` lands inside the @deepseek-ai/dsh package","Avoid wrapper scripts for dsh in personal bin directories"],"tags":["rust","dsh","npm","installation","filesystem"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}