{"record":{"id":"41624a97f912053a","repo":"angular/angular-cli","slug":"no-angular-json-found-at-workspacepathinput-yo","errorCode":null,"errorMessage":"No angular.json found at ${workspacePathInput}. You can use 'list_projects' to find available workspaces.","messagePattern":"No angular\\.json found at (.+?)\\. You can use 'list_projects' to find available workspaces\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/angular/cli/src/commands/mcp/workspace-utils.ts","lineNumber":158,"sourceCode":"  projectNameInput?: string;\n  mcpWorkspace?: AngularWorkspace;\n}): Promise<{\n  workspace: AngularWorkspace;\n  workspacePath: string;\n  projectName: string;\n}> {\n  let workspacePath: string;\n  let workspace: AngularWorkspace;\n\n  if (workspacePathInput) {\n    if (!host.existsSync(workspacePathInput)) {\n      throw new Error(\n        `Workspace path does not exist: ${workspacePathInput}. ` +\n          \"You can use 'list_projects' to find available workspaces.\",\n      );\n    }\n    if (!host.existsSync(join(workspacePathInput, 'angular.json'))) {\n      throw new Error(\n        `No angular.json found at ${workspacePathInput}. ` +\n          \"You can use 'list_projects' to find available workspaces.\",\n      );\n    }\n    if (server) {\n      if (!(await isAllowedWorkspacePath(server, workspacePathInput))) {\n        throw new Error(\n          `Workspace path is outside the allowed MCP roots: ${workspacePathInput}. ` +\n            \"You can use 'list_projects' to find available workspaces.\",\n        );\n      }\n    }\n\n    workspacePath = workspacePathInput;\n    const configPath = join(workspacePath, 'angular.json');\n    try {\n      workspace = await AngularWorkspace.load(configPath);\n    } catch (e) {","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular/cli/src/commands/mcp/workspace-utils.ts#L140-L176","documentation":"After confirming the workspace path exists, resolveWorkspaceAndProject requires an angular.json file directly inside it. If join(workspacePathInput, 'angular.json') does not exist, it throws, again suggesting the 'list_projects' tool. The directory exists but is not an Angular CLI workspace root.","triggerScenarios":"Passing a workspacePath that is an existing directory but has no angular.json at its root — e.g. the repository root when angular.json lives in a subdirectory, or a package/ subfolder of a monorepo — triggering workspace-utils.ts:158.","commonSituations":"Pointing at a repo root in a monorepo where the Angular project is in apps/my-app; pointing at an Nx workspace root that uses workspace.json/project.json without an angular.json; pointing one level too high (e.g. ~/projects instead of ~/projects/my-app).","solutions":["Use 'list_projects' to locate the workspace directory that actually contains angular.json","Point workspacePath at the directory that directly contains angular.json (workspace root)","For Nx monorepos, verify the root layout — Nx can generate angular.json via nx migrate or use the correct root","If using an nx-style setup without angular.json, ensure the tool supports it or generate angular.json at the root"],"exampleFix":"// before\nawait resolveWorkspaceAndProject(host, { workspacePath: '/repo' }); // no angular.json here\n// after\nawait resolveWorkspaceAndProject(host, { workspacePath: '/repo/apps/webapp' }); // contains angular.json","handlingStrategy":"validation","validationCode":"import { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nif (!existsSync(join(workspacePath, 'angular.json'))) {\n  throw new Error(`Not an Angular workspace root (no angular.json): ${workspacePath}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await resolveWorkspaceAndProject(host, { workspacePath });\n} catch (e) {\n  if ((e as Error).message.includes('No angular.json found')) {\n    console.error('Point workspacePath at the directory directly containing angular.json');\n  } else throw e;\n}","preventionTips":["Verify angular.json exists at the exact directory given, not a parent or child","In monorepos, resolve the app-specific workspace root before calling MCP tools","Use 'list_projects' output as the source of truth for workspace paths"],"tags":["filesystem","config","angular-workspace","angular-cli"],"backgroundTag":"angular-json-not-found","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}