title: Cannot find module 'date-fns'
body: <p>When I import installed node module "date-fns" using</p>
  
  <p><code>import { startOfDay } from 'date-fns';</code> </p>
  
  <p>then I get compile error:</p>
  
  <p><code>error TS2307: Cannot find module 'date-fns'.</code> </p>
  
  <p>However following does not give any error:</p>
  
  <p><code>var startOfDay = require('date-fns');</code> </p>
  
  <p>Any idea why this is happening?</p>
  
  <p>Following is my installed date-fns:</p>
  
  <pre><code>node_modules/date-fns/
  ├── start_of_day
  │   ├── index.js
  │   └── index.js.flow
  </code></pre>