paperclipai/paperclip · error
Either packageName or localPath must be provided
Error message
Either packageName or localPath must be provided
What it means
Input guard in fetchAndValidate: neither packageName nor localPath was provided, so there is nothing to resolve or install. The caller must supply exactly one package source; the empty install options are at fault.
Source
Thrown at server/src/services/plugin-loader.ts:1200
*
* This internal helper encapsulates the core plugin retrieval and validation
* logic used by both install and upgrade operations. It handles:
* 1. Resolving the package from npm or local filesystem.
* 2. Installing the package via npm if necessary.
* 3. Reading and parsing the plugin manifest.
* 4. Validating API version compatibility.
* 5. Validating manifest capabilities.
*
* @param installOptions - Options specifying the package to fetch.
* @returns A `DiscoveredPlugin` object containing the validated manifest.
*/
async function fetchAndValidate(
installOptions: PluginInstallOptions,
): Promise<DiscoveredPlugin> {
const { packageName, localPath, version, installDir } = installOptions;
if (!packageName && !localPath) {
throw new Error("Either packageName or localPath must be provided");
}
const targetInstallDir = installDir ?? localPluginDir;
// Step 1 & 2: Resolve and install package
let resolvedPackagePath: string;
let resolvedPackageName: string;
if (localPath) {
// Local path install — validate the directory exists
const absLocalPath = path.resolve(localPath);
if (!existsSync(absLocalPath)) {
throw new Error(`Local plugin path does not exist: ${absLocalPath}`);
}
resolvedPackagePath = absLocalPath;
const pkgJson = await readPackageJson(absLocalPath);
resolvedPackageName =
typeof pkgJson?.["name"] === "string"View on GitHub (pinned to 120ae5428f)
Solutions
- Provide either packageName (npm) or localPath (filesystem) when installing the plugin; exactly one source is required.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at server/src/services/plugin-loader.ts:1200 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/6cb33bc46be31740.
Report an issue: GitHub.