title: Angular 2 Ahead-of-Time compiler error
body: <p>I'm on <code>Windows 7 x64</code>, trying to follow instructions for <a href="https://github.com/angular/angular/tree/master/modules/%40angular/compiler-cli" rel="nofollow noreferrer">Ahead-of-Time compilation</a> of my Angular 2 application. The app compiles and runs fine with Just-in-Time compilation.</p>
  
  <p>I've NPM installed <code>@angular/compiler-cli@0.6.0</code> <code>typescript@2.0.2</code> <code>@angular/platform-server@2.0.0-rc.6</code> and <code>@angular/compiler@2.0.0-rc.6</code></p>
  
  <p>I get the following error when running <code>ngc</code>:</p>
  
  <pre><code>C:\websites\learn\angular2&gt;"node_modules/.bin/ngc" -p dev
  can't resolve module @angular/core/src/di/opaque_token from C:\...\dev\index.ts
  TypeError: undefined is not a function
      at ReflectorHost.findDeclaration (C:\...\node_modules\@angular\compiler-cli\src\reflector_host.js:171:59)
      at StaticReflector.initializeConversionMap (C:\...\node_modules\@angular\compiler-cli\src\static_reflector.js:150:38)
      at new StaticReflector (C:\...\node_modules\@angular\compiler-cli\src\static_reflector.js:42:14)
      at Function.CodeGenerator.create (C:\...\node_modules\@angular\compiler-cli\src\codegen.js:142:31)
      at codegen (C:\...\node_modules\@angular\compiler-cli\src\main.js:7:36)
      at Object.main (C:\...\node_modules\@angular\tsc-wrapped\src\main.js:30:16)
      at Object.&lt;anonymous&gt; (C:\...\node_modules\@angular\compiler-cli\src\main.js:14:9)
      at Module._compile (module.js:460:26)
      at Object.Module._extensions..js (module.js:478:10)
      at Module.load (module.js:355:32)
  Compilation failed
  </code></pre>
  
  <p>Here is my folder structure (<code>tsconfig.json</code> is in <code>angular2</code> at the top-level):
  <a href="https://i.stack.imgur.com/a4ffc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a4ffc.png" alt="enter image description here"></a></p>
  
  <p>At first glance, the error seems <a href="https://github.com/angular/angular/issues/9663" rel="nofollow noreferrer">similar to this one</a>, but a closer look shows that mine ("<em>undefined is not a function</em>") is different. Any ideas?</p>