Ionic ngx-translate type script error help


#1

I have installed ngx-translate according to ionic guide doc but get below Type Script error. when i run the app

Can anyone help on this please

Typescript Error
Cannot find name ‘HttpClient’.
node_modules/@ngx-translate/http-loader/src/http-loader.d.ts
private suffix;
constructor(http: HttpClient, prefix?: string, suffix?: string);
/**
Below is the installation error message in CMD

±- UNMET PEER DEPENDENCY @angular/common@4.1.3

±- UNMET PEER DEPENDENCY @angular/core@4.1.3

Ionic Information as below

Ionic Framework: 3.6.0
Ionic Native: ^2.9.0
Ionic App Scripts: 2.1.3
Angular Core: 4.1.3
Angular Compiler CLI: 4.1.3
Node: 6.11.1
OS Platform: Windows 7
Navigator Platform: Win32


#2

Hello there, did you find any solution for this problem. I am facing exactly the same and I am stuck! :worried:
Can find out how I am able to update the @angular/common and @angular/core.
Thank you!


#3

Yes, if you are following instruction on ionic doc (https://ionicframework.com/docs/developer-resources/ng2-translate/), that is for angularJS ver 3.** and above. just install @ngx-translate/core --save and then install version@ngx-translate/http-loader@1.0.0 --save (i think) check your command line error it will tell what version to install.


#4

You have two options.

The officially supported one is to use @ngx-translate/http-loader@0.1.0.

The other unsupported, may break things, do-at-your-own-risk option (which I have done without running into problems so far) is to update all your Angular dependencies to 4.3+. You will get peer dependency warnings. It should still work, and I like the new HttpClient API better than the old Http one.


#5

Thank you for help!!! It worked form me too!!


#6

Thank you rapropos it works.