Angular-cli: ng update @angular/core fails

Created on 4 May 2018  ·  83Comments  ·  Source: angular/angular-cli

Versions

Angular CLI: 6.0.0
Node: 8.9.1
OS: win32 x64
Angular: 5.2.10
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.6.0
@angular-devkit/core         0.6.0
@angular-devkit/schematics   0.6.0
@angular/cli                 6.0.0
@schematics/angular          0.6.0
@schematics/update           0.6.0
rxjs                         5.5.10
typescript                   2.6.2

Repro steps

Observed behavior

Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=2.7.2 <2.8", would install "2.6.2")
Invalid range: ">=4.3.0"

Desired behavior

I would expect this to work properly.

Mention any other details that might be useful (optional)

I tried to manually update the compiler-cli and run the update function again and got this:

$ ng update @angular/core
Invalid range: ">=4.3.0"
medium broken bufix complex

Most helpful comment

Sorry for beeing so negative and off topic, but what's the point for Google to provide a new ng update command supposed to ease things if we need 58 comments in a an issue and 6 steps, to go from 6.0.0 to 6.0.1 in the end?
I gave up, I will update this later when tools will be less cumbersome to use.

All 83 comments

Temporary workaround seems to be skipping the ng update @angular/cli step and instead runing ng update alone first. This seems to update the core (including CLI) but doesn't touch the angular-cli.json file. Then, upon running ng update @angular/cli it does that upgrade process.

@markgoho-EDT, the ng update itself doesn't do anything else as showing the packages that have to be updated:

ng update
    We analyzed your package.json, there are some packages to update:

      Name                               Version                  Command to update
     --------------------------------------------------------------------------------
      @angular/core                      5.0.5 -> 6.0.0           ng update @angular/core
      @angular/material                  5.2.0 -> 6.0.0           ng update @angular/material
      rxjs                               5.5.2 -> 6.1.0           ng update rxjs


    There might be additional packages that are outdated.
    Or run ng update --all to try to update all at the same time.

Doing ng update --all isn't doing its job either:

ng update --all
                  Package "karma-jasmine-html-reporter" has a missing peer dependency of "jasmine" @ "^3.0.0".
                  Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=2.7.2 <2.8", would install "2.8.3")
                  Package "@auth0/angular-jwt" has an incompatible peer dependency to "@angular/common" (requires "^4.4.6||^5.0.0", would install "6.0.0")
                  Package "ng2-pdf-viewer" has a missing peer dependency of "pdfjs-dist" @ "2.0.489".
Invalid range: ">=6.0.0-rc.0"

I updated the cli first with ng update @angular/cli. Running ng update @angular/core after that gives me the error Invalid range: ">=4.3.0||>5.0.0".

So, the Invalid range: ... doesn't say much. It could at least state from which package.json (aka from which node module this is coming from)

I tried to run ng update @angular/core after updating the cli and my terminal shows this:

[[24;154R

Invalid range: ">=2.3.0 <3.0.0||>=4.0.0"

Same here. I tried to different versions of Typescript (2.4, 2.6, 2.7, 2.8) and i get different "Invalid range" error each time:
Invalid range: ">=5.0.0"
Invalid range: ">=2.3.1 <3.0.0||>=4.0.0"
Invalid range: ">=4.3.0||>5.0.0"

It's always such a pain in the a** to update node packages, ffs.

Same : Invalid range: ">=2.3.1 <3.0.0||>=4.0.0"

same for me, just did
npm install @angular/[email protected]
npm install @angular/[email protected]
...
for all @angular/... package and it was ok

@IterationCorp - this doesn't update your configuration files then, which means your karma, tslint and angular config won't get updated at all.

Same here,

$ ng update --all
                  Package "angular2-moment" has an incompatible peer dependency to "@angular/core" (requires ">=2.0.0 <6.0.0", would install "6.0.0")
                  Package "countup.js-angular2" has an incompatible peer dependency to "ts-node" (requires "~3.2.0", would install "6.0.2").
                  Package "bootstrap" has a missing peer dependency of "popper.js" @ "^1.14.3".
                  Package "ng2-dnd" has an incompatible peer dependency to "@angular/core" (requires "^4.0.0 || ^5.0.0", would install "6.0.0")
Invalid range: ">=4.0.1||>5.0.0||<=6.0.0"

try ng update --all --force but even ng update seems still in beta step or out of scope

Same: Invalid range: ">=5.0.0"

Same here: Invalid range ">2.4.2"

I had the same issue. Upgraded my angular packages manually yarn add @angular/$PACKAGE, run ng update @angular/core again.

Workaround:

  1. Update manually the angular packages to 6.0.0
  2. ng update rxjs
  3. ng update angular/core
  4. ng update angular/material
  5. if ng update installs typescript 2.8.3 you have to install typescript version 2.7.2. angular compiler doesn;t work with 2.8.3

This should have been checked before angular 6.0.0 was released. Now I have to downgrade everything.

My workaround:
remove @angular/compiler-cli from package.json
run ng update @angular/core
npm i --save-dev @angular/compiler-cli@latest

seems to work :D

I was experiencing the same problem reported by @markgoho-EDT, with some changes I was able to fix it, bellow you can see my steps, maybe it will help someone else.

The error message:
Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=2.7.2 <2.8", would install "2.6.2")

I was following along the steps from the https://update.angular.io page, but the above error poped when I was trying to run the ng update @angular/core bit.

What I have installed so far:

  • Angular CLI (local and global): 6.0.0
  • Typescript: 2.8.3

My steps:

$ ng update

  Name                               Version                  Command to update
 --------------------------------------------------------------------------------
  @angular/core                      5.2.10 -> 6.0.0          ng update @angular/core
  rxjs                               5.5.10 -> 6.1.0          ng update rxjs


There might be additional packages that are outdated.
Or run ng update --all to try to update all at the same time.

$ ng update --all

Package "karma-jasmine-html-reporter" has a missing peer dependency of "jasmine" @ "^3.0.0".
Package "@angular/platform-browser-dynamic" has a missing peer dependency of "@angular/compiler" @ "6.0.0".

$ ng update @angular/core

Package not installed: "@angular/compiler". Skipping.

$ ng update @angular/compiler

Package not installed: "@angular/compiler". Skipping.

$ npm install @angular/compiler -> the compiler was installed, but the version was 5.2.0

+ @angular/[email protected]
removed 7 packages and updated 1 package in 11.763s

$ ng update core -> worked fine, no messages this time

Then, just to be sure, run $ ng update again, and got:

We analyzed your package.json and everything seems to be in order. Good work!

This is what I've done, worked for me, maybe will work for someone else. I think the key step was installing the @angular/compiler again, to force its update.

Note: I've just started this project, so no big changes for me, my dev env was almost pristine.

I have updated my project to @angular/cli 6.0.0 and typescript to version 2.8.3.
Now with 'ng build' i have the following error:

ERROR in The Angular Compiler requires TypeScript >=2.7.2 and <2.8.0 but 2.8.3 was found instead.

What is the reason?
What can i do?

Here's the dependencies in my my package.json:

"dependencies": {
"@angular/animations": "^6.0.0",
"@angular/common": "^6.0.0",
"@angular/compiler": "^6.0.0",
"@angular/core": "^6.0.0",
"@angular/forms": "^6.0.0",
"@angular/http": "^6.0.0",
"@angular/platform-browser": "^6.0.0",
"@angular/platform-browser-dynamic": "^6.0.0",
"@angular/platform-server": "^6.0.0",
"@angular/router": "^6.0.0",
"@angular/service-worker": "^6.0.0",
"@ng-idle/core": "^2.0.0-beta.15",
"base64-arraybuffer": "^0.1.5",
"core-js": "^2.5.6",
"font-awesome": "~4.7.0",
"intl": "~1.2.5",
"lodash": "^4.17.10",
"ng2-simple-timer": "^1.3.3",
"ngx-cookie-service": "^1.0.10",
"npm": "^6.0.0",
"primeng": "^5.2.6",
"primeng-extensions-wizard": "~2.2.0",
"rxjs": "^6.1.0",
"web-animations-js": "~2.3.1",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.6.0",
"@angular/cli": "^6.0.0",
"@angular/compiler-cli": "^6.0.0",
"@types/jasmine": "^2.8.7",
"@types/lodash": "^4.14.108",
"@types/node": "^10.0.4",
"codelyzer": "^4.3.0",
"jasmine-core": "~3.1.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "^2.0.2",
"karma-chrome-launcher": "~2.2.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.4.2",
"karma-jasmine": "^1.1.2",
"karma-jasmine-html-reporter": "^1.0.0",
"protractor": "^5.3.1",
"ts-node": "^6.0.3",
"tslint": "^5.10.0",
"typescript": "^2.8.3"
}

If I run ng update I get this result

```
We analyzed your package.json, there are some packages to update:

Name Version Command to update

@angular/core 5.0.5 -> 6.0.0 ng update @angular/core
rxjs 5.5.10 -> 6.1.0 ng update rxjs
```

But If I run ng update @angular/core, I get Invalid range: ">=2.0.0"

This is how I make it work.

My Environment:

Angular CLI Global : 6.0.0, Local: 1.7.4, Angular: 5.2, Typescript: 2.5.3

Note: To enable ng Update you need to install Angular CLI 6.0 first
npm install -g @angular/cli or npm install @angular/cli

  1. ng update //update Angular Package core/common/complier... to 6.0.0

  2. ng update @angular/cli //change angular-cli.json to angular.json

optional if you have angular-material 5.4.2, ngx-translate 9.1.1, ng-bootstrap/ng-bootstrap 1.1.1:

  1. ng update @angular/material //upgrade to 6.0.1

  2. npm install @ngx-translate/[email protected] --save //upgrade ngX translate to 10.0.1 for Angular 6

5 npm install --save @ng-bootstrap/[email protected] //for ng-bootstrap

If you use Observable and get the error:

ERROR in node_modules/rxjs/Observable.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Observable'. node_modules/rxjs/observable/of.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/observable/of'.

Change: import { Observable } from "rxjs/Observable"; import { of } from 'rxjs/observable/of';

To

import { Observable, of } from "rxjs";

I finally got mine to work by doing the following:
Step 1: Run npm ls --depth=1 to see if there is more than one version of webpack.

Step 2: If so, then npm uninstall webpack

Step 3: delete all of the other _webpack-_ related folders in your node_modules directory. It is unnecessary to delete the entire node_modules directory.

Step 4: Run npm install @angular-devkit/build-angular@latest . The @angular-devkit builds contain their own copy of webpack.

Step 5: Ensure that your webpack dependencies are met. You shouldn't see any errors in your console related to webpack not being installed.

@bluefire2121 Did you mean npm ls --depth=1 ?

I also got: Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=2.7.2 <2.8", would install "2.6.2")

I just fixed this by running npm install [email protected] immediately after seeing the error.

I did subsequently get a heck of a lot of warnings and things that look like errors during the angualr/material update though it claimed to complete successfully.

In regards to the Invalid range: xxx errors, I've taken a quick peek at the @angular-devkit/schematics repo to see where the error was thrown and what was actually happening.

The error is thrown at https://github.com/angular/devkit/blob/master/packages/schematics/update/update/index.ts#L41

If I look at the surrounding function, seems that it's expecting semver versioned packages only, and no logical (by the lack of a better term?) versioning.

I would try to debug it further, but can't seem to locate the compiled files in my project to tinker with it.

@Bjeaurn yes 👍 Thank you. Updated.

It appears to be important to initially leave the local @angular/cli version at 1.7.4 (or whatever) and not 6.0.0. This is actually what the "npm install @angular/cli" in the update instructions did do for me, but it also gives a warning that the local one is at an older version that the global one which is at 6.0.0. That caused me to first try setting the local @angular/cli to 6.0.0 like the global one before continuing, but that lead to the range errors.

Starting over again from previous state (everything at 5.2) pulled from version control, I had luck by just ignoring that warning (so local @angular/cli was at 1.7.4 after the "ng update @angular/cli"), and was able to get through the install as described at update.angular.io.

Thanks @scharris
screenshot 2018-05-08 22 52 49

Yeah, @scharris and @manuelescamilla , that method causes this problem: https://github.com/angular/angular-cli/issues/10664

No, it doesn't work for me.

when i call 'ng build' theres always the error:

"ERROR in The Angular Compiler requires TypeScript >=2.7.2 and <2.8.0 but 2.8.3 was found instead."

@bbuehrer : See @tolvaly's comment above, typescript 2.8 is really not supported so you have to install a typescript in that range. I chose 2.7.2 and that worked for me. "npm install [email protected]" and also with -g option.

Downgrading to 2.7.2. breaks a lot of @angular imports with no apparent reason. Using 2.8.3, the imports work but the compiler fails and nothing is usable. Waiting for a fix, I don't know what to do. I already tried to uninstall the whole node_modules folder and start from scratch and the behaviour is the same. I tried verifying my package configuration through npm-check and everything is ok.

When i downgrade to typescript 2.7.2 and use angular/cli 6.0.0 then i have many errors with rxjs/Subscription and rxjs/Observable.
My rxjs version is 6.1.0

@bbuehrer, are you using the new import points for rxjs 6? They are changed (much simplified) so that could just be a legit compile error until imports are adjusted or the rxjs-compat package is added.

ok i added the rxjs-compat package and it worked

how can I find out if a new typescript version is compatible with angular/cli?

I installed typescript 2.7.2 as soon as I got that error, and then proceeded ok.

npm install [email protected]

None of the mentioned solutions helped me because even though I had installed typescript 2.7.2, I had typescript ^2.8.3 in devDependecies. When I changed it to 2.7.2 everything worked correctly. So if you are as stupid as I am, check your package.json, install isn't enough in that case.

Am I the only one that is facing the imports issue downgrading to 2.7.2.? What am I doing wrong? I checked my node_modules, tyescript is 2.7.2 as expected, but none of the imports of classes of angular work anymore.
Anyway, should I expect a fix about this problem or it's gonna take a long time?

@isametal88 did you try to delete node_modules nad package-lock,json and run npm install again?

same Invalid range: ">=4.0.0"

I had to manually add the 6.0.0 to all angular components and 2.7.2 to typescript. then it worked.

@lakerko Yes, I did.

@isametal88 is your global tsc taking over?

tsc -v

I wasn't able to run that command, I tried with this one (it seems to do a similar thing)

npm list -g typescript
[..]
+-- @angular/[email protected]
| -- @schematics/[email protected] |-- [email protected]
+-- [email protected]
| -- [email protected] -- [email protected]
-- [email protected] -- [email protected]

I doubled-check the typescript folder in node_modules and it is 2.7.2.

tsc -v
message TS6029: Version 1.5.3

That version is way too old. Explains why your imports etc aren’t working. Your situation seems unrelated to the reported issue.

I installed tsc this morning. Which is the old package? I verified my package.json using npm-check and everything seems fine.

same here what is the official recommended way forward here?
not giving much confidence in the hyped ng update.

@clement911 just don't npm update to latest the local angular cli before the ng update and you're ok.

Ran into the "Invalid range" error also, just trying to use ng update @angular/cli to update to 6.0.1, something I think should have been easy. Nope. Ended up doing an npm update to get 6.0.1, but still doing ng update @angular/core (because ng update said it needed to), I'm seeing

Invalid range: ">2.4.2"

No idea what is triggering this - it's pretty much a standard CLI app.

edit: Looks like it is trying to update the core angular packages to 6.0.1, but this error is causing the update to fail. As someone above said, doesn't instill much confidence. (I also ran into a pile of errors doing ng update on a moderately large app)

More info. trying to do ng update --all now returns:

Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=2.7.2 <2.8", would install "2.8.3")
Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=2.7.2 <2.8", would install "2.8.3").
Invalid range: ">2.4.2"

My package.json specifies:
"typescript": "2.7.2"
so it should not even be trying to update typescript...

screen shot 2018-05-11 at 6 40 42 pm

Similar issues here. I just started a new Angular 6.0.0 project from CLI 6.0.0 a week ago.
I could update angular-cli to version 6.0.1 but doing
ng update @angular/core shows me
Invalid range: ">=5.0.0"

I have [email protected] and [email protected] installed

Anybody facing the same issue trying to update angular/core from 6.0.0 -> 6.0.1 ?

@ray-kay
I had a clean install of 6.0.0.
When running ng update --all to try update to the 6.0.1, here is the error I have:

Package "karma-jasmine-html-reporter" has a missing peer dependency of "jasmine" @ ">=3".
Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=2.7.2 <2.8", would install "2.8.3").
Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=2.7.2 <2.8", would install "2.8.3")
Incompatible peer dependencies found. See above.

My package.json contains "typescript": "2.7.2" in devDependencies. That makes no sens to me.

@ddahan I had the same issue before I think.
Could solve by just update the locale angular cli on its own:
ng update @angular/cli

Hope this will help with your issue. After that try:
ng update @angular/core and it should say:
Invalid range: ">=5.0.0"

I just run
npm update instead ng update and it updated Angular's packages to 6.0.1 without any issues.
Maybe an issue in the cli ng update dependency detection?

Except, for me anyway, when I initially updated to 6.0, the package.json items were set like
“@angular/common”: “6.0.0”
Locking it to that version. Npm update would not update anything.

Hey Everyone,
After alot of research, I have come up with following solution and got success in updating my local project to Angular 6.0.1:

  1. npm install @angular/{animations,common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router}@'6.0.1'
  2. ng update rxjs
  3. npm install rxjs@6 rxjs-compat@6 --save
  4. ng update angular/core
  5. ng update angular/material
  6. npm install typescript@'>=2.7.0 <2.8.0'

Sorry for beeing so negative and off topic, but what's the point for Google to provide a new ng update command supposed to ease things if we need 58 comments in a an issue and 6 steps, to go from 6.0.0 to 6.0.1 in the end?
I gave up, I will update this later when tools will be less cumbersome to use.

The main problem seems to be with ng update --all not doing its job properly.
Following @Rumsha001 's approach seems to work well.

Just don't forget the @s:

  1. ng update @angular/core
  2. ng update @angular/material

I also needed to ng update @angular/cli

What I was doing:

  1. Follow "Before updating guide" from https://update.angular.io/
  2. Then set a typescript package version to 2.7.2 (yarn upgrade [email protected])
  3. yarn add global @angular/cli
  4. ng update @angular/cli
  5. yarn add @angular/cli
  6. Then continue following the guide
  7. ??????
  8. profit

I tried following the steps @Rumsha001 laid out but was still having "Invalid range" failures at the ng update @angular/core step. Then I changed step 1 to use version '6.0.2' and finally things worked. No guarantees this was the magic touch though ... I tried many things tonight, in various orders, etc.

Overall, very frustrating, I've gotta say ...

I know this is "closed" with a "fix" in place, but trying to ng update to 6.0.2 produces the same "invalid range" error. ng update is more of a problem that it's solving at the moment.

same problem with 6.0.2 what is going on.
`WARNING in ./node_modules/ng-http-loader/node_modules/@angular/core/esm2015/core.js
5354:15-36 Critical dependency: the request of a dependency is an expression

WARNING in ./node_modules/ng-http-loader/node_modules/@angular/core/esm2015/core.js
5370:15-102 Critical dependency: the request of a dependency is an expression`

It certainly looks like ng update needs more work.

But people complaining here should have been around when Angular (2) was still in alpha. It was pretty hairy back then with breaking changes every couple of days sometimes.

That experience taught me it was worth sticking with Angular. It just gets better all the time. Sure a new feature like ng update might not work for everyone straight out of the box but I think we can all rest assured the engineers at Google will be working on it until they get it pretty well right.

Also remember updating from v5 to v6 is going to be a pretty huge task to accomplish with a single tool. After we have updated to v6, I'm sure the update process for future versions will be a whole lot better.

@chriscurnow well. for me to update the angular from 5 to 6 I only needed this thread, ng-update guide and one day)

I couldn't use ng update @angular/core to upgrade to 6.0.2 (because of the non-sense "Invalid range..." error message). Then @angular/cli 6.0.3 has been released. After updating to @angular/cli 6.0.3 all ng update ... command worked well!

@tolvaly How do you "1. Manually update the angular packages to 6.0"?
I tried "ng update @angular/[email protected]" but (after waiting 10 minutes) I get the same error.

@tolvaly How do you "1. Manually update the angular packages to 6.0"?
I tried "ng update @angular/[email protected]" but (after waiting 10 minutes) I get the same error.

"Manually" means that you should update packages using "npm install" instead of "ng update", like this:

npm install @angular/[email protected] --save
npm install @angular/[email protected] --save
etc...

@alberthendriks
How do you "1. Manually update the angular packages to 6.0"?
I tried "ng update @angular/[email protected]" but (after waiting 10 minutes) I get the same error.

Meanwhile I found out why updating doesn't work with ng update. It's because of 3rd-party libraries witch depends on angular.
You have to find out witch of them is breaking your update, and you have to update them manually to the latest version witch support angular and rxjs 6. You have to analyse your package.json, check each dependency under "dependencies". This is also a good opportunity to throw out old libraries witch aren't used or maintained anymore!

Couple of example libraries that broke my update were:

  • @ angular/flex-layout; Currently latest version: 6.0.0-beta.15
  • ng2-signalr; Currently latest version: 6.0.0
  • @ ngx-translate/core; Currently latest version: 10.0.2
  • ngx-moment; Currently latest version: 2.0.0

Until today all of them released a new version supporting angular6, and today I managed to update my packages to angular 6.0.5 running ng update @angular/cli without any issue. I was using angular/cli version 6.0.5

And responding to your question, under manual update I mean, you have to change the version numbers in package.json manually and run npm install to update the outdated packages.

Be aware, when updating rxjs to 6 you should follow this guide

As for many others - after upgrading to angular 6 package.json held fixed "6.0.0" version. Manually switching it to "^6.0.0" and executing npm install @angular/{core,forms,...,router} succesfully updates packages

Running below should help to update your dependencies to latest version.

npm i -g npm-check-updates
ncu -u
npm install

I had a typescript version missmatch like many people (requires ">=2.7.2 <2.8", would install "2.8.3").
My package.json contained typescript 2.7.2 but my package-lock.json contained typescript 2.9...
I remove this entry from package-lock.json and i run npm install [email protected]

I also needed to install angular-devkit/build-angular as dev dependency npm install --save-dev @angular-devkit/build-angular

This solved my problem.

I could have faced incompatible peer dependency issues when i ran the command ng update @angular/core to update the core library of the existing angular project.

Issues

Package "@angular/cdk" has an incompatible peer dependency to "@angular/common" (requires ">=5.0.0-rc.0 <6.0.0||>=4.0.0 <5.0.0", would install "6.0.0").
Package "codelyzer" has an incompatible peer dependency to "@angular/core" (requires ">=5.0.0-rc.0 <6.0.0||>=2.3.1 <3.0.0||>=4.0.0-beta <5.0.0", would install "6.0.0").
Package "codelyzer" has an incompatible peer dependency to "@angular/compiler" (requires ">=5.0.0-rc.0 <6.0.0||>=2.3.1 <3.0.0||>=4.0.0-beta <5.0.0", would install "6.0.0").

in second time i used the following command to update the core library
ng update --next but still there an issue.

issue had fix when i use the following command with --force flag,
ng update @angular/core --next --force

now, my project library has been updated from version 4 to 6. Well done :)

"dependencies": {
"@angular/animations": "^6.0.0",
"@angular/cdk": "^2.0.0-beta.8",
"@angular/common": "^6.0.0",
"@angular/compiler": "^6.0.0",
"@angular/core": "^6.0.0",
"@angular/forms": "^6.0.0",
"@angular/http": "^6.0.0",
"@angular/material": "^2.0.0-beta.8",
"@angular/platform-browser": "^6.0.0",
"@angular/platform-browser-dynamic": "^6.0.0",
"@angular/router": "^6.0.0",
"core-js": "^2.4.1",
"rxjs": "^6.2.0",
"zone.js": "^0.8.26",
"rxjs-compat": "^6.0.0-rc.0"
},

Good Luck !!!

I have facing incompatible peer dependency issues when i ran the command ng update @angular/core to update the core library of the existing angular project.

Package "angulartics2" has an incompatible peer dependency to "@angular/router" (requires ">=7.0.0-rc.0 <8.0.0||>=4.4.0 <=6.0.0", would install "6.0.5").

Package "codelyzer" has an incompatible peer dependency to "@angular/compiler" (requires ">=5.0.0-rc.0 <6.0.0||>=2.3.1 <3.0.0||>=4.0.0-beta <5.0.0", would install "6.0.5").

can some one help on this

@ZeeshanQurban From the message it seems that both of those libraries are specifically disallowing the 6.x.x version range.

I'm not personally using these, but from what I can see:

For angulartics2 it looks like they moved to support Angular 6.x when they released version 6 of the package: https://github.com/angulartics/angulartics2/releases/tag/v6.0.0

For codelyzer it seems they should be supporting Angular 6.x starting with 4.2.1: https://github.com/mgechev/codelyzer/commit/3112b38607f56002106b9039619693193a134eac

I have the same issue with it.

ng update @angular/core

Package "ngx-bootstrap" has an incompatible peer dependency to "@angular/forms" (requires ">=7.0.0-rc.0 <8.0.0||6.0.1", would install "6.0.7").
Incompatible peer dependencies found. See above.

Package.json

"dependencies": {
"@angular/animations": "^6.0.0",
"@angular/common": "^6.0.0",
"@angular/compiler": "^6.0.0",
"@angular/core": "^6.0.0",
"@angular/forms": "^6.0.0",
"@angular/http": "^6.0.0",
"@angular/platform-browser": "^6.0.0",
"@angular/platform-browser-dynamic": "^6.0.0",
"@angular/router": "^6.0.0",
"@auth0/angular-jwt": "^2.0.0",
"alertifyjs": "^1.11.1",
"bootstrap": "^4.1.1",
"bootswatch": "^4.1.1",
"core-js": "^2.5.4",
"font-awesome": "^4.7.0",
"hammerjs": "^2.0.8",
"jquery": "^1.12.4",
"ng2-file-upload": "^1.3.0",
"ngx-bootstrap": "^3.0.0",
"ngx-gallery": "^5.3.2",
"popper.js": "^1.14.3",
"rxjs": "^6.2.1",
"time-ago-pipe": "^1.3.2",
"underscore": "^1.9.1",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.6.1",
"@angular/cli": "^6.0.8",
"@angular/compiler-cli": "^6.0.0",
"@angular/language-service": "^6.0.0",
"@types/jasmine": "~2.8.6",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"@types/underscore": "^1.8.8",
"codelyzer": "~4.2.1",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~1.4.2",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.3.0",
"ts-node": "~5.0.1",
"tslint": "~5.9.1",
"typescript": "~2.7.2"
}

cl-pur-w7-04:freeride.gitlab.io student$ ng update --all
                  Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=2.7.2 <2.10", would install "3.0.1").
Incompatible peer dependencies found. See above.
cl-pur-w7-04:freeride.gitlab.io student$ ng update @angular/cli
    Updating package.json with dependency @angular/cli @ "6.1.2" (was "6.0.8")...
UPDATE package.json (1500 bytes)

> [email protected] install /Users/student/src/freeride.gitlab.io/node_modules/fsevents
> node install

[fsevents] Success: "/Users/student/src/freeride.gitlab.io/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile

> [email protected] install /Users/student/src/freeride.gitlab.io/node_modules/node-sass
> node scripts/install.js

Cached binary found at /Users/student/.npm/node-sass/4.9.0/darwin-x64-64_binding.node

> [email protected] postinstall /Users/student/src/freeride.gitlab.io/node_modules/node-sass
> node scripts/build.js

Binary found at /Users/student/src/freeride.gitlab.io/node_modules/node-sass/vendor/darwin-x64-64/binding.node
Testing binary
Binary is fine
added 1173 packages from 1293 contributors and audited 21839 packages in 40.852s
found 14 vulnerabilities (9 low, 5 high)
  run `npm audit fix` to fix them, or `npm audit` for details
cl-pur-w7-04:freeride.gitlab.io student$ ng serve
^C
cl-pur-w7-04:freeride.gitlab.io student$ ls -a
.           .git            angular.json        package.json        tslint.json
..          .gitignore      e2e         sketch
.DS_Store       .gitlab-ci.yml      node_modules        src
.editorconfig       README.md       package-lock.json   tsconfig.json
cl-pur-w7-04:freeride.gitlab.io student$ ng update --all
                  Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=2.7.2 <2.10", would install "3.0.1")
                  Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=2.7.2 <2.10", would install "3.0.1").
Incompatible peer dependencies found. See above.
cl-pur-w7-04:freeride.gitlab.io student$ ng update
    We analyzed your package.json, there are some packages to update:

      Name                               Version                  Command to update
     --------------------------------------------------------------------------------
      @angular/core                      6.0.3 -> 6.1.1           ng update @angular/core
      rxjs                               6.2.0 -> 6.2.2           ng update rxjs


    There might be additional packages that are outdated.
    Or run ng update --all to try to update all at the same time.

cl-pur-w7-04:freeride.gitlab.io student$ ng update --all
                  Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=2.7.2 <2.10", would install "3.0.1")
                  Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=2.7.2 <2.10", would install "3.0.1").
Incompatible peer dependencies found. See above.
cl-pur-w7-04:freeride.gitlab.io student$ npm install
audited 21839 packages in 8.918s
found 14 vulnerabilities (9 low, 5 high)
  run `npm audit fix` to fix them, or `npm audit` for details
cl-pur-w7-04:freeride.gitlab.io student$ ng update --all
                  Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=2.7.2 <2.10", would install "3.0.1")
                  Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=2.7.2 <2.10", would install "3.0.1").
Incompatible peer dependencies found. See above.
cl-pur-w7-04:freeride.gitlab.io student$

I gotta say, the rabbit hole on this issue is a little nuts. I'm trying an ng update from 6.0.2 to 6.2.4, and I've chased through several missing packages that were apparently added in between those two versions. I started with @angular-devkit/build-angular, but then also hit clean-css, compression and dom-converter. I got stuck on the last two, because attempting to install either one states that the other one is missing. ng update is a big fat fail for me. There should be something to detect missing packages between versions, and install those as part of the ng update process. Otherwise, it's faster to create a project from scratch and manually copy everything over.

npm install [email protected] (or the version you need)
then ng update @angular/core worked for me
Good luck guys

For future reference. I got frustrated trying so many "solutions" with no avail so I decided to just run the following command.

$ ng update --all --force

It was a wild gamble and took a while to update but now everything is working and my project is up-to-date.

ng update --all --force worked for me also.

@kobusbeets I can't say it was a "wild gamble" though, not with a version control system.

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._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

daBishMan picture daBishMan  ·  3Comments

hartjo picture hartjo  ·  3Comments

MateenKadwaikar picture MateenKadwaikar  ·  3Comments

rajjejosefsson picture rajjejosefsson  ·  3Comments

brtnshrdr picture brtnshrdr  ·  3Comments