title: Angular Material (8) S2591: Cannot find name 'require'
body: <p>I am trying to log date/time into the javascript console. The error message I am getting is as follows and was generated by the code below.</p>
  <p><strong>ETA:</strong> the code does work. The dates are going to the console. It is just the Error Message remains</p>
  <p><strong>Message:</strong></p>
  <blockquote>
  <p>ERROR in src/app/kdc/services/customers.api.service.ts(60,9): error
  TS2591: Cannot find name 'require'. Do you need to install type
  definitions for node? Try <code>npm i @types/node</code> and then add <code>node</code> to
  the types field in your tsconfig.</p>
  </blockquote>
  <p>NOTE: I have already made changes to the <code>tsconfig.json</code> file and have also done <code>npm i @types/node</code> and <code>npm i @types/node --save</code> When running <code>npm</code> result was <code>3 high-security vulnerabilities</code> (see below)</p>
  <p><a href="https://i.stack.imgur.com/WIRqa.png" rel="noreferrer"><img src="https://i.stack.imgur.com/WIRqa.png" alt="enter image description here" /></a></p>
  <p>What can I do at this point?`</p>
  <p><strong>customer.api.service.ts</strong></p>
  <pre><code>   getCustomers(): Observable&lt;Customers[]&gt; {
          return this.httpclient.get&lt;Customers[]&gt;(this._url)
          .pipe( catchError(this.handleError));
          
      } 
  
      handleError(error:HttpErrorResponse){
          let rval = Math.random().toString(36).substring(7).toUpperCase();
          require('log-timestamp');
          console.error('MSG NO :' + rval );
          console.error(error);
          return throwError(rval + &quot; &lt;-&gt; &quot; + error.name + &quot; &lt;-&gt; &quot; + error.statusText );
       } 
  </code></pre>
  <p><strong>ETA</strong>
  I found the message here <a href="https://stackoverflow.com/questions/43104114/cannot-find-name-require-after-upgrading-to-angular4">Cannot find name &#39;require&#39; after upgrading to Angular4</a>  and made the change to my
  <code>tsconfig.app.json</code> file - it may be overkill, but it worked ...</p>
  <pre><code>  &quot;compilerOptions&quot;: {
      &quot;outDir&quot;: &quot;./out-tsc/app&quot;,
      &quot;types&quot;: [ &quot;node&quot; ],
      &quot;typeRoots&quot;: [ &quot;../node_modules/@types&quot; ]
    },
  </code></pre>