{"record":{"id":"e86c716bd99f5220","repo":"angular/angular-cli","slug":"unknown-argument-configuration-provide-the-confi","errorCode":null,"errorMessage":"Unknown argument: configuration.\nProvide the configuration as part of the target 'ng run ${targetWithConfig.join(':')}'.","messagePattern":"Unknown argument: configuration\\.\nProvide the configuration as part of the target 'ng run (.+?)'\\.","errorType":"exception","errorClass":"CommandModuleError","httpStatus":null,"severity":"error","filePath":"packages/angular/cli/src/commands/run/cli.ts","lineNumber":56,"sourceCode":"\n    const localYargs: Argv<RunCommandArgs> = argv\n      .positional('target', {\n        describe:\n          'The Architect target to run provided in the following format `project:target[:configuration]`.',\n        type: 'string',\n        demandOption: true,\n        // Show only in when using --help and auto completion because otherwise comma seperated configuration values will be invalid.\n        // Also, hide choices from JSON help so that we don't display them in AIO.\n        choices: (getYargsCompletions || help) && !jsonHelp ? this.getTargetChoices() : undefined,\n      })\n      .middleware((args) => {\n        // TODO: remove in version 15.\n        const { configuration, target } = args;\n        if (typeof configuration === 'string' && target) {\n          const targetWithConfig = target.split(':', 2);\n          targetWithConfig.push(configuration);\n\n          throw new CommandModuleError(\n            'Unknown argument: configuration.\\n' +\n              `Provide the configuration as part of the target 'ng run ${targetWithConfig.join(\n                ':',\n              )}'.`,\n          );\n        }\n      }, true)\n      .strict();\n\n    const target = this.makeTargetSpecifier();\n    if (!target) {\n      return localYargs;\n    }\n\n    const schemaOptions = await this.getArchitectTargetOptions(target);\n\n    return this.addSchemaOptionsToCommand(localYargs, schemaOptions);\n  }","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular/cli/src/commands/run/cli.ts#L38-L74","documentation":"The 'ng run' command builder rejects the deprecated standalone --configuration argument when it is combined with a --target value. Configuration must be encoded in the target specifier itself (project:target:configuration), so passing --configuration is no longer valid.","triggerScenarios":"Running `ng run my-app:build --configuration production` (or programmatic equivalent) with both 'target' and 'configuration' string args; the builder detects the combination and throws a CommandModuleError.","commonSituations":"Scripts or CI configs written for old Angular CLI versions (pre-target-specifier syntax) migrated forward; muscle-memory use of `ng build --configuration` style flags with `ng run`.","solutions":["Move the configuration into the target specifier: `ng run my-app:build:production`.","Remove the --configuration flag entirely if the default configuration is desired.","Update scripts/docs to the modern `ng run <project>:<target>[:<config>]` syntax."],"exampleFix":"// before\nng run my-app:build --configuration production\n// after\nng run my-app:build:production","handlingStrategy":"validation","validationCode":"if (args.configuration && args.target) {\n  throw new Error(`Use 'ng run ${args.target.split(':')[0]}:${args.target.split(':')[1]}:${args.configuration}' instead of --configuration`);\n}","typeGuard":"type TargetSpecifier = `${string}:${string}` | `${string}:${string}:${string}`;\nfunction isTargetSpecifier(v: string): v is TargetSpecifier {\n  return /^[^:]+:[^:]+(:[^:]+)?$/.test(v);\n}","tryCatchPattern":null,"preventionTips":["Use `ng run project:target:configuration` syntax exclusively.","Grep CI scripts for '--configuration' combined with 'ng run'.","Prefer `ng build --configuration X` (without ng run) when config-only override is needed."],"tags":["angular","cli","command-line","deprecated-argument"],"backgroundTag":"unknown-cli-flag","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}