title: A problem with import in TypeScript/Electron.js
body: <p>I have a file <code>index.ts</code>:</p>
  <pre><code>import { app, BrowserWindow } from 'electron'
  let win
  
  app.on('ready', () =&gt; {
    win = new BrowserWindow({
      minHeight: 640,
      minWidth: 480,
      frame:false
    })
    win.loadFile('index.html')
  })
  </code></pre>
  <p>If I try to run with: <code>npm start</code>, I got an error:</p>
  <pre><code>import { app, BrowserWindow } from 'electron'
  ^^^^^^
  
  SyntaxError: Cannot use import statement outside a module
      at wrapSafe (internal/modules/cjs/loader.js:1051:16)
      at Module._compile (internal/modules/cjs/loader.js:1101:27)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1166:10)
      at Module.load (internal/modules/cjs/loader.js:981:32)
      at Module._load (internal/modules/cjs/loader.js:881:14)
      at Function.Module._load (electron/js2c/asar.js:769:28)
      at loadApplicationPackage (D:\VS Projects\Electron App\node_modules\electron\dist\resources\default_app.asar\main.js:109:16)
      at Object.&lt;anonymous&gt; (D:\VS Projects\Electron App\node_modules\electron\dist\resources\default_app.asar\main.js:155:9)
      at Module._compile (internal/modules/cjs/loader.js:1145:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1166:10)
  </code></pre>
  <p>My <code>package.json</code>:</p>
  <pre><code>{
    &quot;name&quot;: &quot;electron-app&quot;,
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;description&quot;: &quot;&quot;,
    &quot;main&quot;: &quot;index.ts&quot;,
    &quot;dependencies&quot;: {
      &quot;electron&quot;: &quot;^10.1.2&quot;
    },
    &quot;devDependencies&quot;: {},
    &quot;scripts&quot;: {
      &quot;start&quot;: &quot;electron .&quot;,
      &quot;test&quot;: &quot;echo \&quot;Error: no test specified\&quot; &amp;&amp; exit 1&quot;
    },
    &quot;author&quot;: &quot;&quot;,
    &quot;license&quot;: &quot;ISC&quot;,
    &quot;type&quot;: &quot;module&quot;
  }
  
  </code></pre>
  <p>How I can solve it?</p>