无法找到angular2-jwt

时间:2018-08-04 16:13:31

标签: angular typescript jwt angular2-routing angular2-services

首先我用npm安装了angular-jwt 和这段代码:

npm install angular2-jwt --save

然后我用jwt import {Observable,map,...}

完成了组件

现在我有问题 该应用无法找到此属性。

ERROR in node_modules/angular2-jwt/angular2-jwt.d.ts(3,10): error TS2305: Module '"F:/Projects/Ove/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/rxjs/Observable.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Observable'.
src/app/github-followers/github-followers.component.ts(1,10): error TS2305: Module '"F:/Projects/Ove/node_modules/rxjs/Observable"' has no exported member 'Observable'.
src/app/services/auth.service.ts(16,8): error TS2339: Property 'map' does not exist on type 'Observable<Response>'.
src/app/services/data.service.ts(6,10): error TS2305: Module '"F:/Projects/Ove/node_modules/rxjs/Observable"' has no exported member 'Observable'.
src/app/services/data.service.ts(18,8): error TS2339: Property 'map' does not exist on type 'Observable<Response>'.
src/app/services/data.service.ts(24,8): error TS2339: Property 'map' does not exist on type 'Observable<Response>'.
src/app/services/data.service.ts(30,8): error TS2339: Property 'map' does not exist on type 'Observable<Response>'.
src/app/services/data.service.ts(36,8): error TS2339: Property 'map' does not exist on type 'Observable<Response>'.
src/app/services/data.service.ts(42,8): error TS2339: Property 'map' does not exist on type 'Observable<Response>'.

1 个答案:

答案 0 :(得分:0)

v6 导入已更改。

v5 是,就像您以前使用的一样:

import { Observable } from 'rxjs/Observable';

v6

import { Observable } from 'rxjs';