升级到Ionic 2.2.0,现在收到有关OpaqueToken和ModuleWithProviders的错误

时间:2017-03-10 16:28:49

标签: angular ionic-framework ionic2

我已从Ionic 2.0.0-rc3升级到2.2.0。为此,我按照https://github.com/driftyco/ionic/blob/master/CHANGELOG.md更改日志上的说明进行操作,并更新了我的package.json

如果我现在运行离子服务,那么我在转换阶段就会看到错误。我不知所措,因为我对OpaqueToken或ModuleWithProviders一无所知,而我的搜索并没有透露任何内容。

MacBook-Pro-3:project chris$ ionic serve

> ionic-hello-world@ ionic:serve /Users/chris/Documents/ionic/project
> ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8102" "--livereload-port" "35731"

[16:25:37]  ionic-app-scripts 1.1.4 
[16:25:37]  watch started ... 
[16:25:37]  build dev started ... 
[16:25:37]  clean started ... 
[16:25:37]  clean finished in 1 ms 
[16:25:37]  copy started ... 
[16:25:37]  transpile started ... 
[16:25:40]  typescript: Users/chris/node_modules/@ionic/cloud-angular/dist/es5/index.d.ts, line: 39 
            Cannot find name 'OpaqueToken'. 

[16:25:40]  typescript: Users/chris/node_modules/@ionic/cloud-angular/dist/es5/index.d.ts, line: 50 
      L39:  export declare const CloudSettingsToken: OpaqueToken;
      L40:  export declare function provideContainer(settings: CloudSettings): DIContainer;

            Cannot find name 'ModuleWithProviders'. 

      L49:  export declare class CloudModule {
      L50:      static forRoot(settings: CloudSettings): ModuleWithProviders;

[16:25:40]  transpile failed 
[16:25:40]  dev server running: http://localhost:8102/ 

[16:25:40]  watch ready in 2.83 s 
[16:25:40]  copy finished in 2.82 s 

1 个答案:

答案 0 :(得分:0)

我设法通过执行以下操作来解决此问题

npm install @ionic/cloud-angular --save

ionic platform remove ios

remove the node_modules directory

npm install

瞧!