title: LernaJS Typescript cannot find module
body: <p>I'm trying to use LernaJS with typescript and I have some problems. When I try to run my package-1 which has package-2 as dependency I get the error:</p>
  <pre>
      module.js:549
          throw err;
          ^
      
      Error: Cannot find module 'package-2'
          at Function.Module._resolveFilename (module.js:547:15)
          at Function.Module._load (module.js:474:25)
          at Module.require (module.js:596:17)
          at require (internal/module.js:11:18)
          at Object. (/home/gabriel/Documentos/projetos/nodejs/lerna-t2/packages/package-1/dist/index.js:3:19)
          at Module._compile (module.js:652:30)
          at Object.Module._extensions..js (module.js:663:10)
          at Module.load (module.js:565:32)
          at tryModuleLoad (module.js:505:12)
          at Function.Module._load (module.js:497:3)
  </pre>
  <p>I've followed the following steps:</p>
  <ol>
  <li>I've created a directory and ran the command 'lerna init'</li>
  <li>I've created 2 folders inside (package-1, package-2) 'packages' folder</li>
  </ol>
  <pre>
      .
      ├── lerna.json
      ├── node_modules
      ├── package.json
      ├── package-lock.json
      └── packages
          ├── package-1
          └── package-2
  </pre>
  <ol start="3">
  <li>I've ran 'npm init' in both (package-1, package-2)</li>
  <li>I've created a basic 'tsconfig.json' in both packages:</li>
  </ol>
  <pre>
      {
          "compilerOptions": {
              "outDir": "dist",
              "target": "es5",
              "module": "commonjs"
          }
      }
  </pre>
  <ol start="5">
  <li>I've ran 'lerna bootstrap' in the root folder</li>
  <li>I've use 'lerna add package-2 --scope=package-1'</li>
  <li>I've ran also 'npm i' in root folder, package-1 and package-2</li>
  <li>I've ran 'tsc -w' in package-1 and package-2 and 'node dist/index.js' in package-1</li>
  </ol>
  <p><strong>FILE TREE</strong></p>
  <p>My 'package-1' file tree:</p>
  <pre>
  
      .
      ├── dist
      │   └── index.js
      ├── index.ts
      ├── node_modules
      │   ├── package-2 -> ../../package-2
      │   └── typescript
      ├── package.json
      ├── package-lock.json
      └── tsconfig.json
  
  </pre>
  <p>My 'package-2' file tree:</p>
  <pre>
  
      .
      ├── dist
      │   ├── index.js
      │   └── lib
      │       └── teste.js
      ├── index.ts
      ├── lib
      │   └── teste.ts
      ├── package.json
      ├── package-lock.json
      └── tsconfig.json
  
  </pre>
  <p><strong>CODE</strong></p>
  <p><strong>package-1</strong>:</p>
  <ul>
  <li>index.ts:</li>
  </ul>
  <pre>
  
      import { Teste } from 'package-2'
      
      new Teste().printHello()
  
  </pre>
  <p><strong>package-2</strong>:</p>
  <ul>
  <li>lib/teste.ts:</li>
  </ul>
  <pre>
  
      export class Teste {
      
          printHello() {
              console.log('Hello!')
          }
      
      }
  
  </pre>
  <ul>
  <li>index.ts:</li>
  </ul>
  <pre>
  
      export { Teste } from './lib/teste'
  
  </pre>