{"record":{"id":"52736412a43fd158","repo":"ReactiveX/rxjs","slug":"project-root-is-not-a-directory-projectroot","errorCode":null,"errorMessage":"Project root is not a directory: ${projectRoot}","messagePattern":"Project root is not a directory: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/migrate/src/skill-install.ts","lineNumber":181,"sourceCode":"  options: SkillInstallOptions & { readonly operation: SkillInstallAction }\n): Promise<SkillInstallResult> {\n  const { operation, ...installOptions } = options;\n  return manageSkillInstallation(operation, installOptions);\n}\n\nfunction adapterFor(harness: SkillHarness): {\n  readonly adapter: SkillInstallAdapter;\n  readonly localPath: string;\n  readonly compatibleHarnesses: readonly SkillHarness[];\n} {\n  const adapter = skillHarnessAdapters[harness];\n  return { adapter: adapter.adapterId, localPath: adapter.targetDirectory, compatibleHarnesses: adapter.compatibleHarnesses };\n}\n\nasync function resolveInstallation(options: SkillInstallOptions): Promise<ResolvedInstallation> {\n  const projectRoot = resolve(options.projectRoot);\n  const canonicalProjectRoot = await realpath(projectRoot);\n  if (!(await stat(canonicalProjectRoot)).isDirectory()) throw new Error(`Project root is not a directory: ${projectRoot}`);\n\n  const canonicalSkillRoot = await realpath(resolve(options.canonicalSkillRoot));\n  if (!(await stat(canonicalSkillRoot)).isDirectory()) throw new Error(`Canonical Skill root is not a directory: ${canonicalSkillRoot}`);\n\n  const adapter = adapterFor(options.harness);\n  const targetPath = resolve(projectRoot, adapter.localPath);\n  assertContained(projectRoot, targetPath, 'Skill target must remain below the project root.');\n  const canonicalTargetPath = await canonicalFuturePath(targetPath);\n  assertContained(canonicalProjectRoot, canonicalTargetPath, 'Skill target resolves outside the project root.');\n  const integrity = await inspectSkillIntegrity(canonicalSkillRoot);\n  const provenance: SkillInstallProvenance = {\n    ...integrity,\n    installSchemaVersion: skillInstallSchemaVersion,\n    adapter: adapter.adapter,\n    compatibleHarnesses: adapter.compatibleHarnesses,\n    targetPath: adapter.localPath.replaceAll(sep, '/'),\n  };\n  return {","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/ReactiveX/rxjs/blob/54796b38a57e6309f9861e174737479bb3f63f61/packages/migrate/src/skill-install.ts#L163-L199","documentation":"Thrown by resolveInstallation when the supplied --project-root exists but is not a directory. Every skill action resolves and validates the project root before touching anything.","triggerScenarios":"Passing --project-root pointing at a file (e.g. package.json or a symlink to a file); realpath resolves successfully but stat().isDirectory() is false.","commonSituations":"Passing the manifest file instead of its directory; a symlink project root that resolves to a file; wrong path in CI config.","solutions":["Pass the project directory, not a file inside it","Verify the path with ls -ld; fix typos","Ensure the symlink target is a real directory"],"exampleFix":"# before\nrxjs-migrate-skill check --harness claude --project-root ./package.json\n# after\nrxjs-migrate-skill check --harness claude --project-root .","handlingStrategy":"validation","validationCode":"import { stat } from 'node:fs/promises';\nif (!(await stat(projectRoot)).isDirectory()) throw new TypeError(`projectRoot not a directory: ${projectRoot}`);","typeGuard":"const isDir = async (p: string) => (await stat(p)).isDirectory();","tryCatchPattern":null,"preventionTips":["Pass directories, not files, to --project-root","Validate CI path variables"],"tags":["cli","filesystem","validation"],"backgroundTag":"path-is-not-a-directory","analyzedSha":"54796b38a57e6309f9861e174737479bb3f63f61","analyzedAt":"2026-08-28T10:21:27.410Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}