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

Unable to update from 13.1.0 to the latest point release #22565

Closed
1 of 15 tasks
jayhamilton opened this issue Jan 25, 2022 · 7 comments
Closed
1 of 15 tasks

Unable to update from 13.1.0 to the latest point release #22565

jayhamilton opened this issue Jan 25, 2022 · 7 comments

Comments

@jayhamilton
Copy link

jayhamilton commented Jan 25, 2022

🐞 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?

no

Description

running ng update or ng update @angular/cli@^13 @angular/core@^13 results in a failure

🔬 Minimal Reproduction

see above

🔥 Exception or Error




The installed Angular CLI version is outdated.
Installing a temporary Angular CLI versioned 13.1.4 to perform the update.
✔ Package successfully installed.
Using package manager: 'npm'
Collecting installed dependencies...
Found 25 dependencies.
Fetching dependency metadata from registry...
    Updating package.json with dependency @angular-devkit/build-angular @ "13.1.4" (was "13.1.1")...
    Updating package.json with dependency @angular/cli @ "13.1.4" (was "13.1.1")...
    Updating package.json with dependency @angular/compiler-cli @ "13.1.3" (was "13.1.0")...
    Updating package.json with dependency @angular/animations @ "13.1.3" (was "13.1.0")...
    Updating package.json with dependency @angular/common @ "13.1.3" (was "13.1.0")...
    Updating package.json with dependency @angular/compiler @ "13.1.3" (was "13.1.0")...
    Updating package.json with dependency @angular/core @ "13.1.3" (was "13.1.0")...
    Updating package.json with dependency @angular/forms @ "13.1.3" (was "13.1.0")...
    Updating package.json with dependency @angular/platform-browser @ "13.1.3" (was "13.1.0")...
    Updating package.json with dependency @angular/platform-browser-dynamic @ "13.1.3" (was "13.1.0")...
    Updating package.json with dependency @angular/router @ "13.1.3" (was "13.1.0")...
  UPDATE package.json (1136 bytes)
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: plm-ui@0.0.0
npm ERR! Found: @angular-devkit/build-angular@13.1.1
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR!   dev @angular-devkit/build-angular@"~13.1.4" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! dev @angular-devkit/build-angular@"~13.1.4" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @angular/core@13.1.3
npm ERR! node_modules/@angular/core
npm ERR!   peer @angular/core@"13.1.3" from @angular/service-worker@13.1.3
npm ERR!   node_modules/@angular/service-worker
npm ERR!     peerOptional @angular/service-worker@"^13.0.0 || ^13.1.0-next" from @angular-devkit/build-angular@13.1.4
npm ERR!     node_modules/@angular-devkit/build-angular
npm ERR!       dev @angular-devkit/build-angular@"~13.1.4" 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! 

🌍 Your Environment

node version 16.13.1
npm version 8.1.2
mac os 10.15.7

@alan-agius4
Copy link
Collaborator

Duplicate of #21204

@alan-agius4 alan-agius4 marked this as a duplicate of #21204 Jan 25, 2022
@jayhamilton
Copy link
Author

jayhamilton commented Jan 25, 2022

@alan-agius4 In that closed issue there is a workaround to use -force, which I did and that just caused more issues. That leaves me with
Switching to yarn or downgrading npm? Is that it?

@alan-agius4
Copy link
Collaborator

Yes, that is right

@vanessag
Copy link

I am having the same issue even updating minor angular 12 versions with same version of node and npm. Are we expected to use the force flag every time we upgrade angular? It seems like there should be a better solution.

It's not a very good user experience to upgrade and then see an error message and have your entire node_modules folder deleted and have to back out and start over.

@alan-agius4
Copy link
Collaborator

@vanessag, unfortunately the error is from NPM 7+ and due to a bug in their peer dependency resolution logic.

See npm/cli#3666 for more context.

In case you are experiencing the error and want to use NPM 7+, the -—force needs to be used. You can also use an alternate package manage such as Yarn which don’t have this bug. You can also downgrade and use NPM 6.

@vanessag
Copy link

@alan-agius4 Thank you for the explanation. I will follow that thread and hopefully npm will have a fix for it at some point.

@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 Feb 26, 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

3 participants