Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ng update fails while upgrading from 12 to 13 #22365

Closed
1 of 15 tasks
TrevorKarjanis opened this issue Dec 13, 2021 · 2 comments
Closed
1 of 15 tasks

Ng update fails while upgrading from 12 to 13 #22365

TrevorKarjanis opened this issue Dec 13, 2021 · 2 comments

Comments

@TrevorKarjanis
Copy link
Contributor

TrevorKarjanis commented Dec 13, 2021

🐞 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.
@TrevorKarjanis TrevorKarjanis 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 Dec 13, 2021
@alan-agius4
Copy link
Collaborator

Duplicate of #21204

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jan 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants