cannot find module '@angular/http'?

Solution 1:

run this in terminal:

npm install @angular/http@latest

Update for Angular 5+ versions:

import {HttpClientModule} from '@angular/common/http'
import {HttpClient} from '@angular/common/http'

instead of HttpModule and Http respectively.

Solution 2:

The entire @angular/http package has been removed. Use @angular/common/http. so instead of importing this one

'@angular/http'

use this

'@angular/common/http'

for further information about other changes go to Angular- Deprecated APIs and Features