paperclipai/paperclip · error

Package directory not found after installation: ${resolvedPa

Error message

Package directory not found after installation: ${resolvedPackagePath}

What it means

Post-install verification: npm reported success but the resolved package directory does not exist under targetInstallDir/node_modules. Indicates a broken install (packaging issue, installDir mismatch); the npm install output/layout is at fault.

Source

Thrown at server/src/services/plugin-loader.ts:1261

        );
      } catch (err) {
        throw new Error(`npm install failed for ${spec}: ${String(err)}`);
      }

      // Resolve the package path after installation
      const nodeModulesPath = path.join(targetInstallDir, "node_modules");
      resolvedPackageName = packageName!;

      // Handle scoped packages
      if (resolvedPackageName.startsWith("@")) {
        const [scope, name] = resolvedPackageName.split("/");
        resolvedPackagePath = path.join(nodeModulesPath, scope!, name!);
      } else {
        resolvedPackagePath = path.join(nodeModulesPath, resolvedPackageName);
      }

      if (!existsSync(resolvedPackagePath)) {
        throw new Error(
          `Package directory not found after installation: ${resolvedPackagePath}`,
        );
      }
    }

    // Step 3: Read and validate plugin manifest
    // Note: this.loadManifest (used via current context)
    const pkgJson = await readPackageJson(resolvedPackagePath);
    if (!pkgJson) throw new Error(`Missing package.json at ${resolvedPackagePath}`);

    if (localPath) {
      await ensureLocalPluginBuilt(resolvedPackagePath, pkgJson);
    }

    const manifestPath = resolveManifestPath(resolvedPackagePath, pkgJson);
    if (!manifestPath || !existsSync(manifestPath)) {
      const manualBuildHint = localPath
        ? formatLocalPluginManualBuildHint(resolvedPackagePath, pkgJson)

View on GitHub (pinned to 120ae5428f)

Solutions

  1. npm reported success but the package directory is absent. Clear the install cache and retry; check for filesystem or permission issues in the install root.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/src/services/plugin-loader.ts:1261 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@120ae5428f (2026-08-18). Data as JSON: /api/errors/ff7a4956ec2366c7. Report an issue: GitHub.