paperclipai/paperclip · critical

Could not locate a Paperclip server entrypoint.\nTried: ${de

Error message

Could not locate a Paperclip server entrypoint.\nTried: ${devEntry}, @paperclipai/server\n${formatError(err)}

What it means

Thrown by importServerEntry() when neither the local dev entrypoint nor the published `@paperclipai/server` package could be resolved. The dev path did not exist on disk, and the production import threw a MODULE_NOT_FOUND whose specifier is absent or exactly `@paperclipai/server`.

Source

Thrown at cli/src/commands/run.ts:204

  // Dev mode: try local workspace path (monorepo with tsx)
  const projectRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../..");
  const devEntry = path.resolve(projectRoot, "server/src/index.ts");
  if (fs.existsSync(devEntry)) {
    ensureDevWorkspaceBuildDeps(projectRoot);
    maybeEnableUiDevMiddleware(devEntry);
    const mod = await import(pathToFileURL(devEntry).href);
    return await startServerFromModule(mod, devEntry);
  }

  // Production mode: import the published @paperclipai/server package
  try {
    const mod = await import("@paperclipai/server");
    return await startServerFromModule(mod, "@paperclipai/server");
  } catch (err) {
    const missingSpecifier = getMissingModuleSpecifier(err);
    const missingServerEntrypoint = !missingSpecifier || missingSpecifier === "@paperclipai/server";
    if (isModuleNotFoundError(err) && missingServerEntrypoint) {
      throw new Error(
        `Could not locate a Paperclip server entrypoint.\n` +
          `Tried: ${devEntry}, @paperclipai/server\n` +
          `${formatError(err)}`,
      );
    }
    throw new Error(
      `Paperclip server failed to start.\n` +
        `${formatError(err)}`,
    );
  }
}

function shouldGenerateBootstrapInviteAfterStart(config: PaperclipConfig): boolean {
  return config.server.deploymentMode === "authenticated" && config.database.mode === "embedded-postgres";
}

async function startServerFromModule(mod: unknown, label: string): Promise<StartedServer> {
  const startServer = (mod as { startServer?: () => Promise<StartedServer> }).startServer;

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Reinstall the CLI with its full dependencies: `pnpm install` / `npm install` (do not prune).
  2. If installed globally, reinstall the global package: `npm i -g @paperclipcli/cli` (or the repo's published name).
  3. Verify resolution: `node -e "import('@paperclipai/server')"` from the install location.
  4. If developing, ensure you are running from the monorepo root where `server/src/index.ts` exists.

Example fix

# before
paperclipai run
# after
pnpm install
node -e "import('@paperclipai/server')"  # verify
paperclipai run
Defensive patterns

Strategy: try-catch

Validate before calling

import { createRequire } from 'node:module';
import fs from 'node:fs';
const require = createRequire(import.meta.url);
function serverResolvable(devEntry: string): boolean {
  if (fs.existsSync(devEntry)) return true;
  try { require.resolve('@paperclipai/server'); return true; } catch { return false; }
}

Try / catch

try {
  await import('@paperclipai/server');
} catch (err) {
  if (isModuleNotFoundError(err)) { console.error('Server package not installed. Reinstall.'); process.exit(1); }
  throw err;
}

Prevention

When it happens

Trigger: Running the CLI outside the monorepo (no `server/src/index.ts`) and `@paperclipai/server` is not installed in node_modules — e.g. a globally installed CLI whose dependencies were pruned, or a partial npm install.

Common situations: Global CLI install that lost its server dependency; `npm install --production` stripping the server; running a dev checkout from the wrong directory so the relative projectRoot resolves to nowhere; corrupt node_modules.

Related errors


AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12). Data as JSON: /api/errors/c78aa09b9309b634. Report an issue: GitHub.