title: Angular 7 - 'Property json does not exist on type Object'
body: <p>I am following a tutorial on building a MEAN stack authentication app, and I have a problem with my registerUser function that's in my auth.server.ts file.</p>
  
  <p>The instructor is using angular 2, which has caused me problems elsewhere, but I was able to find updated solutions to them. This error has caused me problems with a few other courses and I'm not sure how to fix it.</p>
  
  <p>Here is my code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>  registerUser(user) {
      let headers = new HttpHeaders();
      headers.append('Content-Type', 'application/json');
      return this.http.post('http://localhost:5000/users/register', user, { headers: headers }).pipe(map(res =&gt; res.json()));
    }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Here is the complete auth.service.ts file if you need it:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="true" data-console="false" data-babel="false">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import { Injectable } from '@angular/core';
  import { HttpClient, HttpHeaders } from '@angular/common/http';
  import { map } from 'rxjs/operators';
  
  @Injectable({
    providedIn: 'root'
  })
  export class AuthService {
    authToken: any;
    user: any;
  
    constructor(private http: HttpClient) { }
  
    registerUser(user) {
      let headers = new HttpHeaders();
      headers.append('Content-Type', 'application/json');
      return this.http.post('http://localhost:5000/users/register', user, { headers: headers }).pipe(map(res =&gt; res.json()));
    }
  }</code></pre>
  </div>
  </div>
  </p>