ngx-translate/http-loader

Cannot find module '@angular/common/http'.

rodrigoreal opened this issue ยท 6 comments

I can't get it to work with ionic 3.6 with the latest version.
I'm keeping get this error:

Typescript Error
Cannot find module '@angular/common/http'.
node_modules/@ngx-translate/http-loader/src/http-loader.d.ts

I had an old project that i was using ngx-translate with ionic so i checked the version.
If i downgrade to the version below it seems to work:

"@ngx-translate/core": "^6.0.0",
"@ngx-translate/http-loader": "0.0.3"

@rodrigoreal So the solution is to install older version?

It seems so.
@angular/common/http is only available in angular 4.3+.
For prior versions, you should use ngx-translate/http-loader@0.1.0.

@rodrigoreal I updated the version but I still seem to be having the issue ๐Ÿค”

image

UPDATE:

I updated my angular dependencies to the following:

        "@angular/common": "^4.1.3",
        "@angular/compiler": "^4.1.3",        
        "@angular/compiler-cli": "^4.1.3",
        "@angular/core": "^4.1.3",
        "@angular/forms": "^4.1.3",
        "@angular/http": "^4.1.3",
        "@angular/platform-browser": "^4.1.3",
        "@angular/platform-browser-dynamic": "^4.1.3",

Removed node_modules folder and npm install. Seems to be working now. Also, HttpClientModule is only available for Angular 4.3.x and above. More here.

I tried Removed node_modules folder and npm install

Still getting this error.
ERROR in node_modules/ngx-restangular/lib/ngx-restangular-http.d.ts(3,27): error TS2307: Cannot find module '@angular/common/http/src/response'.

@snahmad the same problem here. did you find any solution ?

not using ngx-restangular anymore. using HttpClirnt now.