title: error TS2307: Cannot find module 'crypto'
body: <p>Im writting a web with Angular 6. I need to hash a string client-side, so i'm using <a href="https://nodejs.org/docs/latest-v10.x/api/crypto.html#crypto_crypto_createhash_algorithm_options" rel="noreferrer">createHash("sha256") from 'crypto'</a>.</p>
  
  <p>actually, I just wrote createHash and vscode suggest me the import, which looks like this:</p>
  
  <pre><code>import { createHash } from "crypto";
  </code></pre>
  
  <p>(this way of importing seems to be fine, and it's used in some typescript tutorial, <a href="https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-9.html" rel="noreferrer">here</a>) and then:</p>
  
  <pre><code>var hashed = createHash("sha256").update(data).digest()
  </code></pre>
  
  <p>all syntax is being suggested by vscode, with docstrings and everything. But at the moment of compile with <code>npm start</code> I get:</p>
  
  <pre><code>ERROR in src/domain/User.ts(2,28): error TS2307: Cannot find module 'crypto'.
  </code></pre>
  
  <p>as far as I could understand, <code>crypto</code> is now built-in into node, and I shouldn't have any problem importing it.</p>
  
  <p>also notice that if I run <code>node</code> in terminal to open a REPL, entering 'crypto' gives me an output that suggest that everything works well.</p>
  
  <p>Here are the versions of everything I think that cares:</p>
  
  <pre><code>node --version: v10.15.1
  ng --version:
  Angular CLI: 6.2.9
  Node: 10.15.1
  OS: linux x64
  Angular: 6.1.10
  typescript 2.9.2
  webpack 4.16.4
  </code></pre>
  
  <p>Any help will be appreciated.</p>