paperclipai/paperclip · error · Error
Refusing to use non-directory install-store path
Error message
Refusing to use non-directory install-store path ${directoryPath}. What it means
ensurePrivateDirectory created/inspected the install-store directory and found a non-directory or symlink at the path; the guard refuses to use unsafe store locations.
Solutions
- Point the install-store path at a directory, not a file.
- Remove the non-directory path at ${directoryPath} and retry.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at cli/src/install-store.ts:45 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-08-18).
Data as JSON: /api/errors/aabb5ff211e477e2.
Report an issue: GitHub.
Appendix: source
Thrown at cli/src/install-store.ts:45
previous: InstallRecord[];
};
export type InstallStorePaths = {
paperclipHome: string;
cliRoot: string;
installsRoot: string;
manifestPath: string;
markerPath: string;
lockPath: string;
currentPath: string;
shimPath: string;
};
function ensurePrivateDirectory(directoryPath: string): void {
fs.mkdirSync(directoryPath, { recursive: true, mode: 0o700 });
const stat = fs.lstatSync(directoryPath);
if (!stat.isDirectory() || stat.isSymbolicLink()) {
throw new Error(`Refusing to use non-directory install-store path ${directoryPath}.`);
}
fs.chmodSync(directoryPath, 0o700);
}
function assertOwnedByCurrentUser(stat: fs.Stats, targetPath: string): void {
const getuid = process.getuid;
if (typeof getuid === "function" && stat.uid !== getuid()) {
throw new Error(`Refusing to modify path not owned by the current user: ${targetPath}.`);
}
}
function writeFileAtomic(filePath: string, contents: string, mode: number): void {
const temporaryPath = path.join(
path.dirname(filePath),
`.${path.basename(filePath)}.tmp-${process.pid}-${Date.now()}-${Math.random().toString(16).slice(2)}`,
);
try {
fs.writeFileSync(temporaryPath, contents, { mode, flag: "wx" });View on GitHub (pinned to 01ad858492)