angular/angular-cli · error · SchematicsException

Project name "${options.project}" doesn't not exist.

Error message

Project name "${options.project}" doesn't not exist.

What it means

`addServerRoutingConfig` looks up the target Angular Workspace project by `options.project`. If the workspace definition contains no project with that exact name, it throws this SchematicsException (the message itself has a grammar typo, "doesn't not exist").

Source

Thrown at packages/schematics/angular/app-shell/index.ts:160

    switch (name.kind) {
      case ts.SyntaxKind.Identifier:
        return name.getText() === propertyName;
      case ts.SyntaxKind.StringLiteral:
        return name.text === propertyName;
    }

    return false;
  })[0];

  return property;
}

function addServerRoutingConfig(options: AppShellOptions, isStandalone: boolean): Rule {
  return async (host: Tree) => {
    const workspace = await getWorkspace(host);
    const project = workspace.projects.get(options.project);
    if (!project) {
      throw new SchematicsException(`Project name "${options.project}" doesn't not exist.`);
    }

    const configFilePath = isStandalone
      ? join(project.sourceRoot ?? 'src', 'app/app.config.server.ts')
      : getServerModulePath(host, project.sourceRoot || 'src', 'main.server.ts');

    if (!configFilePath || !host.exists(configFilePath)) {
      throw new SchematicsException(`Cannot find "${configFilePath}".`);
    }

    const configSourceFile = getSourceFile(host, configFilePath);
    const functionCall = findNodes(
      configSourceFile,
      ts.isCallExpression,
      /** max */ undefined,
      /** recursive */ true,
    ).find(
      (n) => ts.isIdentifier(n.expression) && n.expression.getText() === 'provideServerRendering',

View on GitHub (pinned to bb72145f9a)

Solutions

  1. Run with `--project=<exact-name>` using a name listed in angular.json `projects`
  2. Run `ng generate app-shell` inside the project directory or set `defaultProject`/cli default correctly
  3. Fix typos and case in the --project value

Example fix

// before
ng g app-shell --project=my-appp
// after
ng g app-shell --project=my-app
Defensive patterns

Strategy: validation

Validate before calling

const workspace = JSON.parse(fs.readFileSync('angular.json', 'utf8'));
if (!workspace.projects?.[options.project]) {
  throw new Error(`Project "${options.project}" not in angular.json. Available: ${Object.keys(workspace.projects).join(', ')}`);
}

Try / catch

try {
  await ngGenerate('app-shell', { project: projectName });
} catch (e) {
  if (e.message.includes("doesn't not exist")) {
    console.error(`Unknown project "${projectName}" — check angular.json projects key`);
  } else throw e;
}

Prevention

When it happens

Trigger: Running the app-shell schematic with `--project` set to a name that is not a key under `projects` in angular.json/workspace (typo, renamed project, or omitted default when multiple projects exist).

Common situations: Multi-project monorepos where the default project differs; project renamed in angular.json while scripts still use the old name; case-sensitive mismatch between the CLI flag and the workspace key.

Related errors


AI-assisted analysis of angular/angular-cli@bb72145f9a (2026-08-30). Data as JSON: /api/errors/163efdcee3ceccd3. Report an issue: GitHub.