title: TypeScript tricky module not found error
body: <p>I'm using <code>ionic 1</code> and thought it might be a good idea to change to TypeScript. Then of course I wanna use the <code>ionic-native</code> features.</p>
  
  <ul>
  <li>I tried to: <code>import {Calendar} from 'ionic-native';</code> </li>
  <li>but I got: <code>[ts] Cannot find module 'ionic-native'</code>.</li>
  </ul>
  
  <p>So went to read the docs <a href="https://www.typescriptlang.org/docs/handbook/module-resolution.html" rel="noreferrer">How TypeScript resolves modules</a>.
  Docs says it tries to locate the module in following paths:</p>
  
  <pre><code>1. /root/node_modules/moduleB.ts
  2. /root/node_modules/moduleB.tsx
  3. /root/node_modules/moduleB.d.ts
  4. /root/node_modules/moduleB/package.json (if it specifies a "typings" property)
  5. /root/node_modules/moduleB/index.ts
  6. /root/node_modules/moduleB/index.tsx
  7. /root/node_modules/moduleB/index.d.ts 
  </code></pre>
  
  <p>So I looked into my node_folders and see if one path matches:</p>
  
  <pre><code>node_modules
  - ionic-native
  -- dist
  -- package.json
  </code></pre>
  
  <p>So I think number 4. should match, since the package.json contains:</p>
  
  <pre><code>"typings": "dist/es5/index.d.ts
  </code></pre>
  
  <p>But it's not working. </p>
  
  <p>If I instead do:</p>
  
  <pre><code>import {Calendar} from '../../../node_modules/ionic-native/dist/es5/index';
  </code></pre>
  
  <p>it works but I do not want to do it like this in all files, that's way too complicated :/</p>
  
  <hr>
  
  <p>Because I wanted to move forward, I searched for another way in the TypeScript docs. I also could read that you can put a <code>paths property for modules</code> in <code>tsconfig.json</code></p>
  
  <p>But the funny part of it is, if I put correct json it, it doesn't works:</p>
  
  <pre><code>"paths": {
    "ionic-native": ["node_modules/ionic-native/dist/es5/index.d.ts"]
  }
  </code></pre>
  
  <p>When i put invalid json in it, it works (note the missing <code>"</code>):</p>
  
  <pre><code>"paths": {
    ionic-native: ["node_modules/ionic-native/dist/es5/index.d.ts"]
  }
  </code></pre>
  
  <p>Any ideas?</p>