diegosouzapw/OmniRoute · error

Plugin '${name}' is already installed (${existing.version})

Error message

Plugin '${name}' is already installed (${existing.version}) and source version ${manifest.version} is not newer

What it means

Error "Plugin '${name}' is already installed (${existing.version}) and source version ${manifest.version} is not newer" thrown in diegosouzapw/OmniRoute.

Source

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

      : await scanPluginDir(sourceDir);

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

    const discovered = plugins[0];
    const { name, manifest, pluginDir: srcDir } = discovered;

    // If already installed, auto-upgrade when source is strictly newer; reject otherwise.
    if (pluginExists(name)) {
      const existing = getPluginByName(name)!;
      if (compareSemver(manifest.version, existing.version) > 0) {
        // Source is newer — delegate to upgrade()
        return this.upgrade(sourceDir);
      }
      throw new Error(
        `Plugin '${name}' is already installed (${existing.version}) and source version ${manifest.version} is not newer`
      );
    }

    // CRITICAL-3: Copy to staging dir first, validate, then rename atomically.
    const destDir = join(this.pluginDir, name);
    const stagingDir = `${destDir}.staging-${randomUUID()}`;
    await mkdir(dirname(destDir), { recursive: true });
    // Reaching here means the plugin is not DB-registered (the pluginExists()
    // guard above returns/throws otherwise). A destDir still present on disk is
    // therefore orphaned (e.g. a crash mid-uninstall left files behind) and would
    // make the atomic rename below fail with ENOTEMPTY — remove it first, guarded
    // by path containment so we never rm outside the plugin directory.
    assertWithinPluginDir(this.pluginDir, destDir);
    await rm(destDir, { recursive: true, force: true }).catch(() => {});
    await cp(srcDir, stagingDir, { recursive: true });

    try {

View on GitHub (pinned to a179ffed5b)

When it happens

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