找不到“ zen-observable”的类型定义文件

时间:2018-11-08 16:15:32

标签: angular npm ionic3

我正在使用Ionic 3,我只是选择了aws默认模板,但出现错误:

> ionic start app0 aws // aws is a default starting app in Ionic3 
> cd app0
> ionic serve

当我服务时:

错误:

[app-scripts] [16:44:12]  typescript: node_modules/aws-amplify/lib/PubSub/Providers/MqttOverWSProvider.d.ts, line: 2 
[app-scripts]             Cannot find type definition file for 'zen-observable'. 
[app-scripts]        L1:  import { Client } from 'paho-mqtt';
[app-scripts]        L2:  import * as Observable from 'zen-observable';
[app-scripts]        L3:  import { AbstractPubSubProvider } from './PubSubProvider';
[app-scripts] [16:44:12]  typescript: node_modules/aws-amplify/lib/PubSub/Providers/PubSubProvider.d.ts, line: 1 
[app-scripts]             Cannot find type definition file for 'zen-observable'. 
[app-scripts]        L1:  import * as Observable from 'zen-observable';
[app-scripts]        L2:  import { PubSubProvider, ProvidertOptions } from '../types';
[app-scripts]             Cannot find type definition file for 'zen-observable'. 
[app-scripts] [16:44:12]  typescript: node_modules/aws-amplify/lib/PubSub/PubSub.d.ts, line: 1 
[app-scripts]        L1:  import '../Common/Polyfills';       
[app-scripts]        L2:  import * as Observable from 'zen-observable';
[app-scripts] [16:44:12]  typescript: node_modules/aws-amplify/lib/PubSub/types/Provider.d.ts, line: 1 
[app-scripts]             Cannot find type definition file for 'zen-observable'. 
[app-scripts]        L1:  import * as Observable from 'zen-observable';
[app-scripts]        L2:  import { ProvidertOptions } from './PubSub';

离子信息:

  

离子:

     

ionic(Ionic CLI):4.3.1

     

系统:

     

NodeJS:v8.9.4      npm:6.4.1      操作系统:Linux 4.13

1 个答案:

答案 0 :(得分:0)

尝试一下:

npm install –save-dev @types/zen-observable
npm install –save-dev @types/paho-mqtt