{"record":{"id":"7d43ef5ae2607904","repo":"angular/angular-cli","slug":"multiple-projects-found-projectnames-join","errorCode":null,"errorMessage":"Multiple projects found: [${projectNames.join(', ')}]. Please specify a project name.","messagePattern":"Multiple projects found: \\[(.+?)\\]\\. Please specify a project name\\.","errorType":"exception","errorClass":"SchematicsException","httpStatus":null,"severity":"error","filePath":"packages/schematics/angular/refactor/jasmine-vitest/index.ts","lineNumber":44,"sourceCode":"  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']);\n\nfunction findTestFiles(directory: DirEntry, fileSuffix: string): string[] {\n  const files: string[] = [];\n  const stack: DirEntry[] = [directory];\n\n  let current: DirEntry | undefined;\n  while ((current = stack.pop())) {\n    for (const path of current.subfiles) {\n      if (path.endsWith(fileSuffix)) {\n        files.push(current.path + '/' + path);\n      }\n    }\n","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/schematics/angular/refactor/jasmine-vitest/index.ts#L26-L62","documentation":"Thrown by the jasmine-vitest refactor helper's getProject when no --project name was supplied and the workspace contains more than one project, making the target ambiguous. It refuses to guess which project's tests to migrate.","triggerScenarios":"Running the jasmine-vitest refactor without --project in a multi-project workspace (multiple entries in workspace.projects), after getProject found no explicit name and more than one candidate.","commonSituations":"Nx/monorepo-style Angular workspaces with several applications/libraries; running a repo-wide script that omits --project; workspaces that grew from one app to many.","solutions":["Re-run with an explicit --project=<name>.","Run the refactor once per project, each with its own --project flag.","If only one project is actually relevant, temporarily scope the workspace or use a path-scoped include.","Check `ng list` output for the exact project names to pass."],"exampleFix":"// before\nng ref jasmine-vitest\n// after\nng ref jasmine-vitest --project admin","handlingStrategy":"validation","validationCode":"const ws = JSON.parse(fs.readFileSync('angular.json', 'utf8'));\nconst names = Object.keys(ws.projects || {});\nif (!projectName && names.length > 1) {\n  throw new Error(`Workspace has multiple projects (${names.join(', ')}); pass --project.`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runJasmineVitestRefactor(opts);\n} catch (e) {\n  if (String(e.message).startsWith('Multiple projects found')) {\n    const projects = e.message.match(/\\[(.*)\\]/)?.[1].split(', ') ?? [];\n    console.error('Specify --project. Candidates:', projects);\n  } else throw e;\n}","preventionTips":["In multi-project repos, always pass --project explicitly","Script per-project runs instead of assuming a single app","Keep project names consistent across tooling","Fail fast in CI when project count > 1 and --project is missing"],"tags":["angular","schematics","ambiguity","multi-project"],"backgroundTag":"ambiguous-project-selection","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}