{"record":{"id":"ff7a4956ec2366c7","repo":"paperclipai/paperclip","slug":"package-directory-not-found-after-installation","errorCode":null,"errorMessage":"Package directory not found after installation: ${resolvedPackagePath}","messagePattern":"Package directory not found after installation: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/services/plugin-loader.ts","lineNumber":1261,"sourceCode":"        );\n      } catch (err) {\n        throw new Error(`npm install failed for ${spec}: ${String(err)}`);\n      }\n\n      // Resolve the package path after installation\n      const nodeModulesPath = path.join(targetInstallDir, \"node_modules\");\n      resolvedPackageName = packageName!;\n\n      // Handle scoped packages\n      if (resolvedPackageName.startsWith(\"@\")) {\n        const [scope, name] = resolvedPackageName.split(\"/\");\n        resolvedPackagePath = path.join(nodeModulesPath, scope!, name!);\n      } else {\n        resolvedPackagePath = path.join(nodeModulesPath, resolvedPackageName);\n      }\n\n      if (!existsSync(resolvedPackagePath)) {\n        throw new Error(\n          `Package directory not found after installation: ${resolvedPackagePath}`,\n        );\n      }\n    }\n\n    // Step 3: Read and validate plugin manifest\n    // Note: this.loadManifest (used via current context)\n    const pkgJson = await readPackageJson(resolvedPackagePath);\n    if (!pkgJson) throw new Error(`Missing package.json at ${resolvedPackagePath}`);\n\n    if (localPath) {\n      await ensureLocalPluginBuilt(resolvedPackagePath, pkgJson);\n    }\n\n    const manifestPath = resolveManifestPath(resolvedPackagePath, pkgJson);\n    if (!manifestPath || !existsSync(manifestPath)) {\n      const manualBuildHint = localPath\n        ? formatLocalPluginManualBuildHint(resolvedPackagePath, pkgJson)","sourceCodeStart":1243,"sourceCodeEnd":1279,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/server/src/services/plugin-loader.ts#L1243-L1279","documentation":"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.","triggerScenarios":"Thrown at server/src/services/plugin-loader.ts:1261 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}