Repository navigation
Ng update fails while upgrading from 12 to 13 #22365
Description
🐞 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
- Generate a new workspace and application with Angular 12.
- Run
npm install. - 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.
- Revert
package.json. - With
node_modulesdeleted, runnpm install. - Delete
package-lock.json. - Run
npx @angular/cli@13 update @angular/core@13 @angular/cli@13.
Activity
[-]Ng update fails while upgrading from 12 to 13 with a new workspace[/-][+]Ng update fails while upgrading from 12 to 13[/+]alan-agius4 commentedon Dec 13, 2021
Duplicate of #21204
angular-automatic-lock-bot commentedon Jan 14, 2022
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.