Skip to content

Ng update fails while upgrading from 12 to 13 #22365

Closed

Description

@TrevorKarjanis

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Yes, the previous version in which this bug was not present was upgrading 11 to 12. However, it is also reproducible upgrading from 12.2.7 to 12.2.13. I have also reproduced this upgrading an existing workspace.

Description

The ng update command fails with the below mentioned error while upgrading a newly generated workspace from 12 to 13. No modifications to the repository were made.

🔬 Minimal Reproduction

  1. Generate a new workspace and application with Angular 12.
  2. Run npm install.
  3. Run npx @angular/cli@13 update @angular/core@13 @angular/cli@13.

🔥 Exception or Error

    Updating package.json with dependency @angular/router @ "13.1.0" (was "12.2.14")...
  UPDATE package.json (1065 bytes)
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: test@0.0.0
npm ERR! Found: @angular-devkit/build-angular@12.2.14
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR!   dev @angular-devkit/build-angular@"~13.1.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! dev @angular-devkit/build-angular@"~13.1.1" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @angular/compiler-cli@13.1.0
npm ERR! node_modules/@angular/compiler-cli
npm ERR!   peer @angular/compiler-cli@"^13.0.0 || ^13.1.0-next" from @angular-devkit/build-angular@13.1.1
npm ERR!   node_modules/@angular-devkit/build-angular
npm ERR!     dev @angular-devkit/build-angular@"~13.1.1" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /Users/trevor/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/trevor/.npm/_logs/2021-12-13T18_17_29_516Z-debug.log
✖ Package install failed, see above.

🌍 Your Environment

Angular CLI: 12.2.14
Node: 16.13.0 (Unsupported)
Package Manager: npm 8.1.0
OS: darwin x64

Angular: 12.2.14
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.1202.14
@angular-devkit/build-angular 12.2.14
@angular-devkit/core 12.2.14
@angular-devkit/schematics 12.2.14
@schematics/angular 12.2.14
rxjs 6.6.7
typescript 4.3.5

Anything else relevant?

Issue#22162 is related but is about the node_modules directory. It outlines the following workaround. However, I wouldn't expect a workaround to be required.

  1. Revert package.json.
  2. With node_modules deleted, run npm install.
  3. Delete package-lock.json.
  4. Run npx @angular/cli@13 update @angular/core@13 @angular/cli@13.

Activity

  1. changed the title [-]Ng update fails while upgrading from 12 to 13 with a new workspace[/-] [+]Ng update fails while upgrading from 12 to 13[/+] on Dec 13, 2021
  2. alan-agius4 commented on Dec 13, 2021

    @alan-agius4
    Collaborator

    Duplicate of #21204

  3. angular-automatic-lock-bot commented on Jan 14, 2022

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  4. locked and limited conversation to collaborators on Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions