私はWindows 7 x64
にあり、私のAngular 2アプリケーションのAhead-of-Time compilationの指示に従おうとしています。アプリはジャストインタイムのコンパイルでうまくコンパイルして実行します。角度2の予期しないコンパイラエラー
私はNPMはngc
を実行するときに、私は次のエラーを取得する@angular/[email protected]
[email protected]
@angular/[email protected]
と@angular/[email protected]
をインストールしている:ここで
C:\websites\learn\angular2>"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.<anonymous> (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
は私のフォルダ構造である(tsconfig.json
がトップレベルでangular2
です) :
一見すると、th eエラーはsimilar to this oneと思われますが、詳細を見ると、鉱山(「未定義は関数ではありません」)が異なっています。何か案は?
https://github.com/角度/角度/問題/ 10792 –
ちょっと@GünterZöchbauer。私はその問題を投稿する前に見ました。その場合、 'ngc'は実際に実行することができます。期待されるファイルは生成されません。 '.ngfactory.ts'の代わりに' .js'、 '.js.map'、' .json'ファイルを出力します。私の場合、 'ngc'クラッシュとして何も出力されない – BeetleJuice