diegosouzapw/OmniRoute · error · InstallError

Could not read installed version from…

Error message

Could not read installed version from node_modules/9router/package.json

What it means

Post-install verification guard in the ninerouter installer: after `runNpm install` of the 9router package, getInstalledVersion() could not read a version from node_modules/9router/package.json. The install step appeared to succeed but the package manifest is missing or invalid — indicating a partial install, npm cache issue, or filesystem problem in NINEROUTER_INSTALL_DIR.

Solutions

  1. Delete the ninerouter install directory and retry
  2. Clear npm cache and verify npm can install the package standalone
  3. Check disk space and permissions on the install dir
  4. Review npm logs for silent extraction failures
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/lib/services/installers/ninerouter.ts:88 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/446182c086cd777e. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/services/installers/ninerouter.ts:88

      JSON.stringify(
        { name: "omniroute-9router-host", version: "0.0.0", private: true, dependencies: {} },
        null,
        2
      ),
      "utf8"
    );
  }

  await runNpm(
    ["install", `${NINEROUTER_PACKAGE}@${version}`, "--omit=dev", "--no-audit", "--no-fund"],
    // `--prefix` is passed via `prefix` (→ npm_config_prefix env) instead of an
    // argv path so an install dir with spaces survives the Windows shell (#5379).
    { cwd: NINEROUTER_INSTALL_DIR, prefix: NINEROUTER_INSTALL_DIR }
  );

  const installedVersion = await getInstalledVersion();
  if (!installedVersion) {
    throw new InstallError(
      "Could not read installed version from node_modules/9router/package.json",
      "9router instalado mas versão não pôde ser lida.",
      500
    );
  }

  await upsertVersionManagerTool({
    tool: "9router",
    installedVersion,
    binaryPath: getServerPath(),
    status: "stopped",
  });

  // Invalidate cache so next getLatestVersion() re-fetches
  latestVersionCache = null;

  return {
    installedVersion,

View on GitHub (pinned to a179ffed5b)