diegosouzapw/OmniRoute · error

Plugin ' ' is not installed — use install() instead

Error message

Plugin '${name}' is not installed — use install() instead

What it means

upgrade() pre-condition: getPluginByName(name) returned null — the plugin discovered in the source directory is not currently installed, so there is nothing to upgrade. Directs the caller to install().

Solutions

  1. Call install() instead of upgrade() for uninstalled plugins
  2. Check for a name mismatch between the manifest and the installed plugin name
  3. Install the plugin first, then upgrade
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/lib/plugins/manager.ts:286 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/98332bfcc7881d04. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/plugins/manager.ts:286

        discovered = { name: result.data.name, manifest: result.data, pluginDir: sourceDir };
      }
    } catch {}

    if (!discovered) {
      const { plugins, errors } = await scanPluginDir(sourceDir);
      if (plugins.length === 0) {
        throw new Error(
          `No valid plugin found in ${sourceDir}: ${errors.map((e) => e.error).join(", ")}`
        );
      }
      discovered = plugins[0];
    }

    const { name, manifest } = discovered;

    // Must be already installed
    if (!pluginExists(name)) {
      throw new Error(`Plugin '${name}' is not installed — use install() instead`);
    }

    const existing = getPluginByName(name)!;

    // Source must be strictly newer
    if (compareSemver(manifest.version, existing.version) <= 0) {
      throw new Error(
        `Plugin '${name}' upgrade rejected: source version ${manifest.version} is not newer than installed ${existing.version}`
      );
    }

    log.info("manager.upgrading", { name, from: existing.version, to: manifest.version });

    // Deactivate if active before touching files
    if (existing.status === "active") {
      await this.deactivate(name);
    }

View on GitHub (pinned to a179ffed5b)