{"record":{"id":"b714adb25d51dbc7","repo":"remix-run/remix","slug":"rmx-target-path-not-directory","errorCode":"RMX_TARGET_PATH_NOT_DIRECTORY","errorMessage":"Target path is not a directory","messagePattern":"Target path is not a directory","errorType":"error_code","errorClass":"CliError","httpStatus":null,"severity":"error","filePath":"packages/cli/src/lib/errors.ts","lineNumber":137,"sourceCode":"    title: 'Route-map loader exited from a signal',\n    fix: 'Check app/routes.ts for side effects or runtime issues and try again.',\n  },\n  routeOwnerPlanUnresolved: {\n    code: 'RMX_ROUTE_OWNER_PLAN_UNRESOLVED',\n    title: 'Could not resolve a route owner plan',\n  },\n  routesFileNotFound: {\n    code: 'RMX_ROUTES_FILE_NOT_FOUND',\n    title: 'Could not find app/routes.ts',\n    fix: 'Run this command inside a Remix app that has app/routes.ts.',\n  },\n  targetDirectoryNotEmpty: {\n    code: 'RMX_TARGET_DIRECTORY_NOT_EMPTY',\n    title: 'Target directory is not empty',\n    fix: 'Re-run with --force to continue.',\n  },\n  targetPathNotDirectory: {\n    code: 'RMX_TARGET_PATH_NOT_DIRECTORY',\n    title: 'Target path is not a directory',\n    fix: 'Choose a directory path for the new app target.',\n  },\n  unexpectedExtraArgument: {\n    code: 'RMX_UNEXPECTED_ARGUMENT',\n    title: 'Unexpected extra argument',\n    fix: 'Remove the extra argument or run the command with --help.',\n  },\n  unknownArgument: {\n    code: 'RMX_UNKNOWN_ARGUMENT',\n    title: 'Unknown argument',\n    fix: 'Run the command with --help to see supported arguments.',\n  },\n  unknownCommand: {\n    code: 'RMX_UNKNOWN_COMMAND',\n    title: 'Unknown command',\n    fix: 'Run `remix help` to see available commands.',\n  },","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/remix-run/remix/blob/9696913134be3a4423513d2775f7b31d6917c049/packages/cli/src/lib/errors.ts#L119-L155","documentation":"The path you supplied as the app target exists but is a file (or otherwise not a directory), so the CLI cannot scaffold a project there. The fix hint tells you to choose a directory path.","triggerScenarios":"Passing a path that resolves to an existing file, a symlink to a file, or a path with a trailing filename component as the target of a create command.","commonSituations":"Typos like `remix init app.txt`, targets colliding with existing files (package.json, README), or symlink confusion in workspaces.","solutions":["Choose a new or existing directory path as the target.","Remove or rename the colliding file if it was created by mistake.","Check for symlinks pointing at files with `ls -l <path>`."],"exampleFix":"# before\nremix init ./notes.md\n\n# after\nremix init ./my-new-app","handlingStrategy":"validation","validationCode":"import { stat } from 'node:fs/promises'\n\nlet s = await stat(target).catch(() => null)\nif (s && !s.isDirectory()) {\n  // pick a different target before running the command\n}","typeGuard":null,"tryCatchPattern":"try {\n  await scaffold(target)\n} catch (error) {\n  if (error.code === 'RMX_TARGET_PATH_NOT_DIRECTORY') {\n    // choose a directory path and retry\n  }\n}","preventionTips":["Pass directory-like paths to create commands.","Check for name collisions with existing files."],"tags":["cli","filesystem","invalid-path"],"backgroundTag":"path-is-not-a-directory","analyzedSha":"9696913134be3a4423513d2775f7b31d6917c049","analyzedAt":"2026-08-27T19:55:01.024Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}