angular/angular-cli · info
NOTE: The "--dry-run" option means no changes were made.
Error message
NOTE: The "--dry-run" option means no changes were made.
What it means
In runSchematic, after a schematic executes with the --dry-run option, the CLI logs a warning clarifying that because dry-run mode was active no files were actually modified. This is informational, not a failure; the command returns 0.
Source
Thrown at packages/angular/cli/src/command-builder/schematics-command-module.ts:364
const { unsubscribe, files } = subscribeToWorkflow(workflow, logger);
try {
await workflow
.execute({
collection: collectionName,
schematic: schematicName,
options: schematicOptions,
logger,
allowPrivate: this.allowPrivateSchematics,
})
.toPromise();
if (!files.size) {
logger.info('Nothing to be done.');
}
if (executionOptions.dryRun) {
logger.warn(`\nNOTE: The "--dry-run" option means no changes were made.`);
return 0;
}
if (files.size) {
// Note: we could use a task executor to format the files but this is simpler.
try {
await formatFiles(this.context.root, files);
} catch (error) {
assertIsError(error);
logger.warn(
`WARNING: Formatting of files failed with the following error: ${error.message}`,
);
}
}
return 0;View on GitHub (pinned to bb72145f9a)
Solutions
- No fix needed — expected behavior. Re-run without `--dry-run` to apply the changes.
- If changes should be applied in automation, remove the --dry-run flag from the command.
Example fix
// before (preview only) ng g component hero --dry-run // after (actually writes files) ng g component hero
Defensive patterns
Strategy: validation
Validate before calling
if (process.argv.includes('--dry-run') && autoApplyExpected) {
console.warn('Refusing to run: --dry-run prevents file writes.');
process.exit(1);
} Prevention
- Remove --dry-run from commands intended to write files.
- In CI, assert the dry-run preview output matches expectations before running for real.
When it happens
Trigger: Running `ng generate ... --dry-run` or `ng new --dry-run` where the schematic would have created/modified files (files.size > 0) but executionOptions.dryRun was true.
Common situations: Previewing a generator before committing changes (`ng g component --dry-run`); CI scripts that run schematics in dry-run mode to validate templates; users confused why nothing changed on disk.
Related errors
- schematicName cannot be undefined.
- The "not" keyword is not supported in JSON Schema.
- Could not find (/.angular.json)
- Unknown schematics built-in module '${id}' requested from sc
- A collection and schematic is required during execution.
AI-assisted analysis of angular/angular-cli@bb72145f9a (2026-08-30).
Data as JSON: /api/errors/11cf07c5f6216a71.
Report an issue: GitHub.