title: Cannot find module "tslib"
body: <p>I am experiencing this issue and don't seem to have any answer so far. Although I see tslib in my node_modules folder. Appreciate if anyone can help identify whats wrong with my code. I have seen other responses to similar question, I tried removing node_modules and rebuild the whole project. But I still get the same issue</p>
  <pre class="lang-js prettyprint-override"><code>Uncaught Error: Cannot find module &quot;tslib&quot;.
      at webpackEmptyContext (VM2488 main.js:11)
      at VM2487 vendor.js:30768
      at push../node_modules/@angular/compiler/src/core.js (VM2487 vendor.js:30756)
      at Object../node_modules/@angular/compiler/src/core.js (VM2487 vendor.js:30765)
      at __webpack_require__ (VM2484 runtime.js:77)
      at Object../src/app/data.service.ts (VM2488 main.js:2712)
      at __webpack_require__ (VM2484 runtime.js:77)
      at Object../src/app/Security/Security.service.ts (VM2488 main.js:1923)
      at __webpack_require__ (VM2484 runtime.js:77)
      at Object../src/app/Security/Security.component.ts (VM2488 main.js:1556)
  </code></pre>
  <p>Package.json</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;name&quot;: &quot;ranetworkfe&quot;,
    &quot;version&quot;: &quot;0.0.0&quot;,
    &quot;scripts&quot;: {
      &quot;ng&quot;: &quot;ng&quot;,
      &quot;start&quot;: &quot;ng serve&quot;,
      &quot;build&quot;: &quot;ng build&quot;,
      &quot;test&quot;: &quot;ng test&quot;,
      &quot;lint&quot;: &quot;ng lint&quot;,
      &quot;e2e&quot;: &quot;ng e2e&quot;
    },
    &quot;private&quot;: true,
    &quot;dependencies&quot;: {
      &quot;@angular/animations&quot;: &quot;^6.0.3&quot;,
      &quot;@angular/cli&quot;: &quot;^6.1.2&quot;,
      &quot;@angular/common&quot;: &quot;^6.0.3&quot;,
      &quot;@angular/compiler&quot;: &quot;^6.0.3&quot;,
      &quot;@angular/core&quot;: &quot;^6.0.3&quot;,
      &quot;@angular/forms&quot;: &quot;^6.0.3&quot;,
      &quot;@angular/http&quot;: &quot;^6.0.3&quot;,
      &quot;@angular/platform-browser&quot;: &quot;^6.0.3&quot;,
      &quot;@angular/platform-browser-dynamic&quot;: &quot;^6.0.3&quot;,
      &quot;@angular/router&quot;: &quot;^6.0.3&quot;,
      &quot;bootstrap&quot;: &quot;^4.1.3&quot;,
      &quot;core-js&quot;: &quot;^2.5.4&quot;,
      &quot;express&quot;: &quot;^4.16.3&quot;,
      &quot;font-awesome&quot;: &quot;^4.7.0&quot;,
      &quot;jasmine&quot;: &quot;^3.1.0&quot;,
      &quot;jquery&quot;: &quot;^3.3.1&quot;,
      &quot;rxjs&quot;: &quot;^6.2.2&quot;,
      &quot;rxjs-compat&quot;: &quot;^6.2.2&quot;,
      &quot;tslib&quot;: &quot;^1.9.3&quot;,
      &quot;zone.js&quot;: &quot;^0.8.26&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;@angular-devkit/build-angular&quot;: &quot;~0.6.8&quot;,
      &quot;@angular/cli&quot;: &quot;^6.1.2&quot;,
      &quot;@angular/compiler-cli&quot;: &quot;^6.0.3&quot;,
      &quot;@angular/language-service&quot;: &quot;^6.0.3&quot;,
      &quot;@types/jasmine&quot;: &quot;~2.8.6&quot;,
      &quot;@types/jasminewd2&quot;: &quot;~2.0.3&quot;,
      &quot;@types/node&quot;: &quot;~8.9.4&quot;,
      &quot;codelyzer&quot;: &quot;~4.2.1&quot;,
      &quot;jasmine-core&quot;: &quot;~2.99.1&quot;,
      &quot;jasmine-spec-reporter&quot;: &quot;~4.2.1&quot;,
      &quot;karma&quot;: &quot;~1.7.1&quot;,
      &quot;karma-chrome-launcher&quot;: &quot;~2.2.0&quot;,
      &quot;karma-coverage-istanbul-reporter&quot;: &quot;~2.0.0&quot;,
      &quot;karma-jasmine&quot;: &quot;~1.1.1&quot;,
      &quot;karma-jasmine-html-reporter&quot;: &quot;^0.2.2&quot;,
      &quot;protractor&quot;: &quot;^5.4.0&quot;,
      &quot;ts-node&quot;: &quot;~5.0.1&quot;,
      &quot;tslint&quot;: &quot;~5.9.1&quot;,
      &quot;tslib&quot;: &quot;^1.9.3&quot;,
      &quot;typescript&quot;: &quot;~2.7.2&quot;
    }
  }
  </code></pre>
  <p>tsconfig.js</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;compilerOptions&quot;: {
      &quot;baseUrl&quot;: &quot;&quot;,
      &quot;declaration&quot;: false,
      &quot;emitDecoratorMetadata&quot;: true,
      &quot;experimentalDecorators&quot;: true,
      &quot;lib&quot;: [&quot;es6&quot;, &quot;dom&quot;],
      &quot;mapRoot&quot;: &quot;./&quot;,
      &quot;module&quot;: &quot;es6&quot;,
      &quot;moduleResolution&quot;: &quot;node&quot;,
      &quot;outDir&quot;: &quot;../dist/out-tsc&quot;,
      &quot;sourceMap&quot;: true,
      &quot;target&quot;: &quot;es5&quot;,
      &quot;importHelpers&quot;: true,
      &quot;typeRoots&quot;: [
        &quot;../node_modules/@types&quot;
      ]
    }
  }
  </code></pre>
  <h5>UPDATED</h5>
  <p>DataService.ts</p>
  <pre class="lang-js prettyprint-override"><code>/*
   * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   * http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  import { Injectable } from '@angular/core';
  import { Http, Response, Headers } from '@angular/http';
  import { Observable } from 'rxjs';
  import { map, filter, scan, catchError } from 'rxjs/operators';
  import { Type } from '@angular/compiler/src/core';
  
  @Injectable()
  export class DataService&lt;Type&gt; {
      private resolveSuffix = '?resolve=true';
      private actionUrl: string;
      private headers: Headers;
  
      constructor(private http: Http) {
          this.actionUrl = '/api/';
          this.headers = new Headers();
          this.headers.append('Content-Type', 'application/json');
          this.headers.append('Accept', 'application/json');
      }
  
      public getAll(ns: string): Observable&lt;Type[]&gt; {
          console.log('GetAll ' + ns + ' to ' + this.actionUrl + ns);
          return this.http.get(`${this.actionUrl}${ns}`).pipe(
              map(response =&gt; {
                  const chamados = response.json();
                  return chamados.map((chamado) =&gt; new Type(chamado));
                 // catchError(this.handleError);
              }
             // catchError(this.handleError);
          )
             // catchError(this.handleError);
          ).catch(this.handleError)
          //.map(this.extractData)
          
      }
  
      public getSingle(ns: string, id: string): Observable&lt;Type&gt; {
          console.log('GetSingle ' + ns);
  
          return this.http.get(this.actionUrl + ns + '/' + id + this.resolveSuffix).pipe(
              //.map(this.extractData)
              map(response =&gt; {
                  const chamados = response.json();
                  return chamados.map((chamado) =&gt; new Type(chamado));
              }
              )
          )
          //catchError(this.handleError);
      }
  
      public add(ns: string, asset: Type): Observable&lt;Type&gt; {
          console.log('Entered DataService add');
          console.log('Add ' + ns);
          console.log('asset', asset);
  
          return this.http.post(this.actionUrl + ns, asset).pipe(
              //.map(this.extractData)
              map(response =&gt; {
                  const chamados = response.json();
                  return chamados.map((chamado) =&gt; new Type(chamado));
              }))
         // catchError(this.handleError);
          //.map(this.extractData)
          //.catch(this.handleError);
      }
  
      public update(ns: string, id: string, itemToUpdate: Type): Observable&lt;Type&gt; {
          console.log('Update ' + ns);
          console.log('what is the id?', id);
          console.log('what is the updated item?', itemToUpdate);
          console.log('what is the updated item?', JSON.stringify(itemToUpdate));
          return this.http.put(`${this.actionUrl}${ns}/${id}`, itemToUpdate).pipe(
              //.map(this.extractData)
              map(response =&gt; {
                  const chamados = response.json();
                  return chamados.map((chamado) =&gt; new Type(chamado));
              }))
         // catchError(this.handleError);
          // .map(this.extractData)
          //.catch(this.handleError);
      }
  
      public delete(ns: string, id: string): Observable&lt;Type&gt; {
          console.log('Delete ' + ns);
  
          return this.http.delete(this.actionUrl + ns + '/' + id).pipe(
              //.map(this.extractData)
              map(response =&gt; {
                  const chamados = response.json();
                  return chamados.map((chamado) =&gt; new Type(chamado));
              }))
          //catchError(this.handleError);
          // .map(this.extractData)
          //.catch(this.handleError);
      }
  
      private handleError(error: any): Observable&lt;string&gt; {
          // In a real world app, we might use a remote logging infrastructure
          // We'd also dig deeper into the error to get a better message
          const errMsg = (error.message) ? error.message :
              error.status ? `${error.status} - ${error.statusText}` : 'Server error';
          console.error(errMsg); // log to console instead
          return Observable.throw(errMsg);
      }
  
      private extractData(res: Response): any {
          return res.json();
      }
  
  }
  </code></pre>