title: error TS2339: Property 'catchError' does not exist on type 'Observable<any>'
body: <p>Here is my code in book.service.ts :</p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { Http, Response } from '@angular/http';
  import {Observable} from 'rxjs';
  import { Book } from './book';
  import { map } from "rxjs/operators";
  import { catchError } from 'rxjs/operators';
  
  //import { Component, OnInit } from '@angular/core';
  //import {HttpClient} from "@angular/common/http";
  //import { Observable } from 'rxjs/Observable'; 
  //import 'rxjs/add/operator/map';
  //import 'rxjs/add/operators/catch';
  //import 'rxjs/operators/toPromise';
  
  @Injectable()
  export class BookService 
  {
      url = "http://localhost:4200/assets/data/books.json";
  
      constructor(private http:Http) { }
  
      getBooksWithObservable(): Observable&lt;Book[]&gt; 
      {
          return this.http.get(this.url)
                  .pipe(map(this.extractData))
                  .catchError(this.handleErrorObservable);
      }
      getBooksWithPromise(): Promise&lt;Book[]&gt; 
      {
          return this.http.get(this.url).toPromise()
              .then(this.extractData)
              .catch(this.handleErrorPromise);
      }
      private extractData(res: Response) 
      {
          let body = res.json();
          return body;
      }
      private handleErrorObservable (error: Response | any) 
      {
          console.error(error.message || error);
          //console.log("Error in Observable");
          return Observable.throw(error.message || error);
      }
      private handleErrorPromise (error: Response | any) 
      {
          console.error(error.message || error);
          return Promise.reject(error.message || error);
      }   
  }
  </code></pre>
  
  <p>And I m getting the Error here: </p>
  
  <blockquote>
    <p>ERROR in src/app/book.service.ts(26,18): error TS2339: Property 'catchError' does not exist on type 'Observable'.</p>
  </blockquote>
  
  <p>Well the Error is in 26th line and that is : </p>
  
  <pre><code>.catchError(this.handleErrorObservable); 
  </code></pre>
  
  <p>I've tried a lot of things but nothing worked... Can anybody solve this?</p>
  
  <p>Did with 'catch' but didn't work, so then I go for 'catchError' but still, there is this error...</p>