2017-02-26 35 views
1

我的角2的應用是很好的工作,直到今天早上,當我開始VS和與此錯誤消息出口「LOCATION_INITIALIZED」在「@角/通用」

WARNING in ./~/@angular/router/src/router_module.js 
303:51-71 "export 'LOCATION_INITIALIZED' was not found in '@angular/common' 

迎了上去,並以下以及沒有被發現

Unhandled Promise rejection: Token must be defined! ; Zone: <root> ; Task: Promise.then ; Value: Error: Token must be defined! 
at new ReflectiveKey (reflective_key.js:36) [angular] 
at KeyRegistry.get (reflective_key.js:89) [angular] 
at Function.ReflectiveKey.get (reflective_key.js:54) [angular] 
at ReflectiveInjector_.get (reflective_injector.js:325) [angular] 
at AppModuleInjector.NgModuleInjector.get (ng_module_factory.js:140) [angular] 
at RouterInitializer.appInitializer (router_module.js:303) [angular] 
at new ApplicationInitStatus (application_init.js:30) [angular] 
at AppModuleInjector.createInternal (/AppModule/module.ngfactory.js:597) [angular] 
at AppModuleInjector.NgModuleInjector.create (ng_module_factory.js:123) [angular] 
at NgModuleFactory.create (ng_module_factory.js:91) [angular] 
at :8080/dist/app.bundle.js:47522:61 [angular] 
at Object.onInvoke (ng_zone.js:273) [angular] Error: Token must be defined! 
at new ReflectiveKey (http://localhost:8080/dist/app.bundle.js:49098:19) [angular] 
at KeyRegistry.get (http://localhost:8080/dist/app.bundle.js:49151:39) [angular] 
at Function.ReflectiveKey.get (http://localhost:8080/dist/app.bundle.js:49116:35) [angular] 
at ReflectiveInjector_.get (http://localhost:8080/dist/app.bundle.js:130453:102) [angular] 
at AppModuleInjector.NgModuleInjector.get (http://localhost:8080/dist/app.bundle.js:69771:52) [angular] 
at RouterInitializer.appInitializer (http://localhost:8080/dist/app.bundle.js:82228:48) [angular] 
at new ApplicationInitStatus (http://localhost:8080/dist/app.bundle.js:47099:45) [angular] 
at AppModuleInjector.createInternal (/AppModule/module.ngfactory.js:597:36) [angular] 
at AppModuleInjector.NgModuleInjector.create (http://localhost:8080/dist/app.bundle.js:69754:76) [angular] 
at NgModuleFactory.create (http://localhost:8080/dist/app.bundle.js:69722:18) [angular] 
at http://localhost:8080/dist/app.bundle.js:47522:61 [angular] 
at Object.onInvoke (http://localhost:8080/dist/app.bundle.js:36376:37) angular] 
consoleError @ zone.js:405 
zone.js:407 Error: Uncaught (in promise): Error: Token must be defined! 
Error: Token must be defined! 
at new ReflectiveKey (reflective_key.js:36) [angular] 
at KeyRegistry.get (reflective_key.js:89) [angular] 
at Function.ReflectiveKey.get (reflective_key.js:54) [angular] 
at ReflectiveInjector_.get (reflective_injector.js:325) [angular] 
at AppModuleInjector.NgModuleInjector.get (ng_module_factory.js:140) [angular] 
at RouterInitializer.appInitializer (router_module.js:303) [angular] 
at new ApplicationInitStatus (application_init.js:30) [angular] 
at AppModuleInjector.createInternal (/AppModule/module.ngfactory.js:597) [angular] 
at AppModuleInjector.NgModuleInjector.create (ng_module_factory.js:123) [angular] 
at NgModuleFactory.create (ng_module_factory.js:91) [angular] 
at :8080/dist/app.bundle.js:47522:61 [angular] 
at Object.onInvoke (ng_zone.js:273) [angular] 
at new ReflectiveKey (reflective_key.js:36) [angular] 
at KeyRegistry.get (reflective_key.js:89) [angular] 
at Function.ReflectiveKey.get (reflective_key.js:54) [angular] 
at ReflectiveInjector_.get (reflective_injector.js:325) [angular] 
at AppModuleInjector.NgModuleInjector.get (ng_module_factory.js:140) [angular] 
at RouterInitializer.appInitializer (router_module.js:303) [angular] 
at new ApplicationInitStatus (application_init.js:30) [angular] 
at AppModuleInjector.createInternal (/AppModule/module.ngfactory.js:597) [angular] 
at AppModuleInjector.NgModuleInjector.create (ng_module_factory.js:123) [angular] 
at NgModuleFactory.create (ng_module_factory.js:91) [angular] 
at :8080/dist/app.bundle.js:47522:61 [angular] 
at Object.onInvoke (ng_zone.js:273) [angular] 
at resolvePromise (zone.js:486) [<root>] 
at :8080/dist/polyfills.bundle.js:18027:17 [<root>] 
at Zone.runTask (zone.js:151) [<root> => <root>] 
at drainMicroTaskQueue (zone.js:418) [<root>] 

應用程序在運行時編譯和問題表面。我正在使用角色2與打字稿2.1.6

回答

2

好的,我再次工作。在VS啓動時,它確實對一些軟件包進行了一些更新。因此,我拿出了整個node_module文件夾,並確保我有適當的軟件包版本,並且重新安裝恢復了所有內容。

+0

任何想法什麼是適當的軟件包? – BrandonReid

+0

是的,事實證明我有一個「〜,^」前綴的軟件包版本的混合物,而一些軟件包根本沒有前綴。所以在更新之後,我的軟件包版本不匹配。所以我用「〜」前綴所有版本號,並刪除了重新啓動的node_module文件夾。 –

3

如果有其他人遇到此問題,@ angular/router(3.4.0)的最新版本不兼容與其他角度2的依賴關係,回滾到3.3.0解決了這個問題。這可悲的是一個非常熟悉的經驗...