{"record":{"id":"f40657a4f4ed0d3c","repo":"angular/angular-cli","slug":"package-specifier-has-no-effect-when-using-migrat","errorCode":null,"errorMessage":"Package specifier has no effect when using \"migrate-only\" option.","messagePattern":"Package specifier has no effect when using \"migrate-only\" option\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/angular/cli/src/commands/update/cli.ts","lineNumber":211,"sourceCode":"    for (const request of options.packages ?? []) {\n      try {\n        const packageIdentifier = npa(request);\n\n        // only registry identifiers are supported\n        if (!packageIdentifier.registry) {\n          logger.error(`Package '${request}' is not a registry package identifer.`);\n\n          return 1;\n        }\n\n        if (packages.some((v) => v.name === packageIdentifier.name)) {\n          logger.error(`Duplicate package '${packageIdentifier.name}' specified.`);\n\n          return 1;\n        }\n\n        if (options.migrateOnly && packageIdentifier.rawSpec !== '*') {\n          logger.warn('Package specifier has no effect when using \"migrate-only\" option.');\n        }\n\n        // Wildcard uses the next tag if next option is used otherwise use latest tag.\n        // Wildcard is present if no selector is provided on the command line.\n        if (packageIdentifier.rawSpec === '*') {\n          packageIdentifier.fetchSpec = options.next ? 'next' : 'latest';\n          packageIdentifier.type = 'tag';\n        }\n\n        packages.push(packageIdentifier);\n      } catch (e) {\n        assertIsError(e);\n        logger.error(e.message);\n\n        return 1;\n      }\n    }\n","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular/cli/src/commands/update/cli.ts#L193-L229","documentation":"When `ng update --migrate-only` is used, no packages are actually updated — only migrations run — so any package specifier (like a version range) supplied on the command line has no effect. The CLI logs this warning and continues, unless the specifier is the implicit wildcard '*' (no specifier given).","triggerScenarios":"Running e.g. `ng update @angular/core@16 --migrate-only` (or any non-'*' rawSpec) so the condition `options.migrateOnly && packageIdentifier.rawSpec !== '*'` is true.","commonSituations":"Copy-pasting an update command and appending --migrate-only to run only migrations; scripting migrate-only runs while retaining version selectors from previous full-update commands.","solutions":["Remove the package specifier: run `ng update @angular/core --migrate-only` (or just `ng update --migrate-only`) so no meaningless selector is passed.","If you actually want the package updated too, drop --migrate-only and run a normal `ng update @angular/core@<version>`.","Update scripts/CI configs to strip version selectors from migrate-only invocations."],"exampleFix":"// before\nng update @angular/core@16 --migrate-only\n// after\nng update @angular/core --migrate-only","handlingStrategy":"validation","validationCode":"const args = ['ng', 'update', ...pkgs];\nif (migrateOnly) {\n  // strip version selectors when migrate-only\n  args.splice(args.indexOf('@angular/core@16'), 1, '@angular/core');\n}","typeGuard":null,"tryCatchPattern":"if (migrateOnly && pkgSpecifier !== '*') {\n  logger.warn('Specifier ignored with --migrate-only; dropping it');\n  pkgSpecifier = undefined;\n}","preventionTips":["Drop version selectors from `ng update` commands that use --migrate-only.","Keep separate script targets: one for full updates, one for migrate-only runs.","Remember --migrate-only never changes package versions."],"tags":["update","cli-usage","angular-cli","migrations"],"backgroundTag":"ineffective-cli-option-combination","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}