2017-02-21 17 views
1

angular-cliの使用中に次のエラーが発生します。Angular2エラートークンを定義する必要があります

Error: Token must be defined! 
    at new ReflectiveKey (http://localhost:4200/vendor.bundle.js:48893:19) [angular] 
    at KeyRegistry.get (http://localhost:4200/vendor.bundle.js:48946:39) [angular] 
    at Function.ReflectiveKey.get (http://localhost:4200/vendor.bundle.js:48911:35) [angular] 
    at ReflectiveInjector_.get (http://localhost:4200/vendor.bundle.js:117530:102) [angular] 
    at AppModuleInjector.NgModuleInjector.get (http://localhost:4200/vendor.bundle.js:66988:52) [angular] 
    at RouterInitializer.appInitializer (http://localhost:4200/vendor.bundle.js:73780:48) [angular] 
    at new ApplicationInitStatus (http://localhost:4200/vendor.bundle.js:46874:45) [angular] 
    at AppModuleInjector.createInternal (/AppModule/module.ngfactory.js:424:36) [angular] 
    at AppModuleInjector.NgModuleInjector.create (http://localhost:4200/vendor.bundle.js:66971:76) [angular] 
    at NgModuleFactory.create (http://localhost:4200/vendor.bundle.js:66939:18) [angular] 
    at http://localhost:4200/vendor.bundle.js:47309:61 [angular] 
    at Object.onInvoke (http://localhost:4200/vendor.bundle.js:37314:37) [angular] 

enter image description here

+0

をテキストとして完全なエラーメッセージを投稿してください動作するはずです。 –

+0

詳細をお知らせください。 –

+0

これは私がブラウザから得た唯一の情報であり、私は自分のアプリケーションを実行することができません。私は、角度cliを使用しています – Rohit

答えて

0

私は新鮮なNPMが作業プロジェクトからインストールし実行した後、同じエラーを受けています。下のzone.jsなどの "^"の依存関係については、Package.jsonファイルを確認してください。 "^"を削除して、npmが指定されたバージョンをインストールし、後でインストールしないようにします。

その後、あなたのnode_modulesを再インストールし、それが

"dependencies": { 
"@angular/common": "2.4.2", 
"@angular/compiler": "2.4.2", 
"@angular/core": "2.4.2", 
"@angular/forms": "2.4.2", 
"@angular/http": "2.4.2", 
"@angular/material": "2.0.0-beta.1", 
"@angular/platform-browser": "2.4.2", 
"@angular/platform-browser-dynamic": "2.4.2", 
"@angular/router": "^3.4.2", 
"@ngrx/core": "^1.1.0", 
"@ngrx/effects": "^2.0.0", 
"@ngrx/store": "^2.1.2", 
"@ngrx/store-devtools": "^3.2.3", 
"core-js": "^2.4.1", 
"material-design-icons": "^3.0.1", 
"reflect-metadata": "^0.1.3", 
"reselect": "^2.5.4", 
"rxjs": "5.0.1", 
"systemjs": "0.19.27", 
"zone.js": "^0.7.2" 
関連する問題