{"record":{"id":"35ad1a93a73e8c28","repo":"angular/angular-cli","slug":"project-projectname-not-found","errorCode":null,"errorMessage":"Project \"${projectName}\" not found.","messagePattern":"Project \"(.+?)\" not found\\.","errorType":"exception","errorClass":"SchematicsException","httpStatus":null,"severity":"error","filePath":"packages/schematics/angular/refactor/jasmine-vitest/index.ts","lineNumber":31,"sourceCode":"  SchematicsException,\n  Tree,\n} from '@angular-devkit/schematics';\nimport { join, normalize } from 'node:path/posix';\nimport { ProjectDefinition, getWorkspace } from '../../utility/workspace';\nimport { Schema } from './schema';\nimport { transformJasmineToVitest } from './test-file-transformer';\nimport { RefactorReporter } from './utils/refactor-reporter';\n\nasync function getProject(\n  tree: Tree,\n  projectName: string | undefined,\n): Promise<{ project: ProjectDefinition; name: string }> {\n  const workspace = await getWorkspace(tree);\n\n  if (projectName) {\n    const project = workspace.projects.get(projectName);\n    if (!project) {\n      throw new SchematicsException(`Project \"${projectName}\" not found.`);\n    }\n\n    return { project, name: projectName };\n  }\n\n  if (workspace.projects.size === 1) {\n    const [name, project] = Array.from(workspace.projects.entries())[0];\n\n    return { project, name };\n  }\n\n  const projectNames = Array.from(workspace.projects.keys());\n  throw new SchematicsException(\n    `Multiple projects found: [${projectNames.join(', ')}]. Please specify a project name.`,\n  );\n}\n\nconst DIRECTORIES_TO_SKIP = new Set(['node_modules', '.git', 'dist', '.angular']);","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/schematics/angular/refactor/jasmine-vitest/index.ts#L13-L49","documentation":"Thrown by the jasmine-vitest refactor helper's getProject when an explicit projectName is given but no project with that name exists in the workspace. The helper needs a ProjectDefinition to scope the test migration.","triggerScenarios":"Calling the jasmine-to-vitest refactor with `--project <name>` (the `{ project, name: projectName }` call site) where <name> is misspelled or was renamed/removed from angular.json.","commonSituations":"Typos in the project name; running after a project was renamed in a workspace restructure; monorepo workspaces where the project lives in a different angular workspace root.","solutions":["List workspace projects (`ng list` or read angular.json) and re-run with an exact project name.","Fix the --project flag spelling.","Remove the --project flag to let the tool auto-select when only one project exists.","If the project was renamed, update angular.json or use the new name."],"exampleFix":"// before\nng ref jasmine-vitest --project appp\n// after\nng ref jasmine-vitest --project app","handlingStrategy":"validation","validationCode":"const workspace = JSON.parse(fs.readFileSync('angular.json', 'utf8'));\nconst names = Object.keys(workspace.projects || {});\nif (projectName && !names.includes(projectName)) {\n  throw new Error(`Unknown project '${projectName}'. Known: ${names.join(', ')}`);\n}","typeGuard":"function projectExists(ws: { projects: Record<string, unknown> }, name: string): boolean {\n  return Object.prototype.hasOwnProperty.call(ws.projects, name);\n}","tryCatchPattern":"try {\n  await runJasmineVitestRefactor({ project: projectName });\n} catch (e) {\n  if (String(e.message).includes('not found')) {\n    console.error(`Project '${projectName}' does not exist. Run 'ng list'.`);\n  } else throw e;\n}","preventionTips":["Copy project names verbatim from `ng list` output","Re-check names after workspace renames or migrations","Omit --project in single-project workspaces to avoid typos entirely","Lint CI scripts against the current angular.json project list"],"tags":["angular","schematics","workspace","project-not-found"],"backgroundTag":"project-not-found","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}