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 results in npm ERR! Could not resolve dependency #20347

Closed
egnexstep opened this issue Mar 22, 2021 · 4 comments
Closed

ng update results in npm ERR! Could not resolve dependency #20347

egnexstep opened this issue Mar 22, 2021 · 4 comments

Comments

@egnexstep
Copy link

I have a angular project I created last week, running Angular 11.2.25 and I thought I would update to the latest version ( I see that the latest version now is 11.2.6 for core)

Running ng update, shows:

The installed local Angular CLI version is older than the latest stable version.
Installing a temporary version to perform the update.
Installing packages for tooling via npm.
Installed packages for tooling via npm.
Using package manager: 'npm'
Collecting installed dependencies...
Found 35 dependencies.
We analyzed your package.json, there are some packages to update:

  Name                               Version                  Command to update
 --------------------------------------------------------------------------------
  @angular/cli                       11.2.4 -> 11.2.5         ng update @angular/cli
  @angular/core                      11.2.5 -> 11.2.6         ng update @angular/core

There might be additional packages which don't provide 'ng update' capabilities that are outdated.
You can update the additional packages by running the update command of your package manager.

And then running ng update @angular/cli just shows me this:

The installed local Angular CLI version is older than the latest stable version.
Installing a temporary version to perform the update.
Installing packages for tooling via npm.
Installed packages for tooling via npm.
Using package manager: 'npm'
Collecting installed dependencies...
Found 35 dependencies.
Fetching dependency metadata from registry...
Updating package.json with dependency @angular-devkit/build-angular @ "0.1102.5" (was "0.1102.4")...
Updating package.json with dependency @angular/cli @ "11.2.5" (was "11.2.4")...
UPDATE package.json (1486 bytes)
⠙ Installing packages (npm)...npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: @angular-devkit/[email protected]
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR! dev @angular-devkit/build-angular@"~0.1102.5" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev @angular-devkit/build-angular@"~0.1102.5" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @angular/[email protected]
npm ERR! node_modules/@angular/service-worker
npm ERR! peerOptional @angular/service-worker@"^11.0.0 || ^11.2.0-next" from @angular-devkit/[email protected]
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR! dev @angular-devkit/build-angular@"~0.1102.5" 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/bjojo/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/bjojo/.npm/_logs/2021-03-22T10_14_39_738Z-debug.log
✖ Package install failed, see above.
✖ Migration failed. See above for further details.

Shouldn't this just work or am I missing something? (I also tried using --force, with the same result...)

@alan-agius4
Copy link
Collaborator

Which version of NPM 7 are you using?

If you are not using 7.6 or later, kindly update.

@egnexstep
Copy link
Author

I am using npm version 7.6.3

@alan-agius4
Copy link
Collaborator

This seems like a duplicate of #20180 where it looks like an NPM defect as 11.2.6 does satisfy ^11.0.0 || ^11.2.0-next but NPM is saying it does not.

@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 Apr 22, 2021
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