title: "Cannot use import statement outside a module" in typeorm migration when run nestjs app
body: <p>I have created the nestjs app. In the root app folder I have these subfolders:</p>
  
  <ul>
  <li>dist</li>
  <li>migration</li>
  <li>src</li>
  <li>test</li>
  </ul>
  
  <p>The migration folder contains typeorm migrations.<br>
  When run application with <em>npm run start:dev</em> I have this error:</p>
  
  <pre><code>import {MigrationInterface, QueryRunner} from "typeorm";
  ^^^^^^
  
  SyntaxError: Cannot use import statement outside a module
      at Module._compile (internal/modules/cjs/loader.js:891:18)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
      at Module.load (internal/modules/cjs/loader.js:811:32)
      at Function.Module._load (internal/modules/cjs/loader.js:723:14)
      at Module.require (internal/modules/cjs/loader.js:848:19)
      at require (internal/modules/cjs/helpers.js:74:18)
      at Function.PlatformTools.load (C:\Users\dakru1\Documents\employo\employo-api\node_modules\typeorm\platform\PlatformTools.js:114:28)
      at C:\Users\dakru1\Documents\employo\employo-api\node_modules\typeorm\util\DirectoryExportedClassesLoader.js:39:69
      at Array.map (&lt;anonymous&gt;)
      at Object.importClassesFromDirectories (C:\Users\dakru1\Documents\employo\employo-api\node_modules\typeorm\util\DirectoryExportedClassesLoader.js:39:10)
  </code></pre>
  
  <p>I understand the error message and I know how to fix it when it relates to application's code. </p>
  
  <p>However, my problem is that this error come from typeorm migration file: <code>[app-root-folder]\migration\1587067680466-Init.ts</code> which shouldn't be used when application runs.</p>
  
  <p>Why nestjs uses migration files. How can I ignore migration folder when running nestjs app?</p>