Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 找不到模块';rxjs/内部/可观察';_Angular_Typescript_Jwt_Token - Fatal编程技术网

Angular 找不到模块';rxjs/内部/可观察';

Angular 找不到模块';rxjs/内部/可观察';,angular,typescript,jwt,token,Angular,Typescript,Jwt,Token,我想在我的服务中使用JwtHelperService模块,但出现以下错误: ERROR in node_modules/@auth0/angular-jwt/src/jwt.interceptor.d.ts(3,28): error TS2307: Cannot find module 'rxjs/internal/Observable'. 我已在我的服务中验证了功能 import { JwtHelperService } from '@auth0/angular-jwt'; import *

我想在我的服务中使用JwtHelperService模块,但出现以下错误:

ERROR in node_modules/@auth0/angular-jwt/src/jwt.interceptor.d.ts(3,28): error TS2307: Cannot find module 'rxjs/internal/Observable'.
我已在我的服务中验证了功能

import { JwtHelperService } from '@auth0/angular-jwt';
import * as jwt_decode from 'jwt-decode';

@Injectable()
export class MembershipService{
    constructor(private http: Http,
       private mainService: MainService,
       public jwtHelper: JwtHelperService){}

    public isAuthenticated(): boolean {
        const token = localStorage.getItem('loggedToken');
        // Check whether the token is expired and return
        // true or false
        return !this.jwtHelper.isTokenExpired(token);

    }
}
我的angular版本也是5.0


我非常感谢您的帮助

听起来这与RxJS版本不匹配。angular2 jwt v2以RxJS v6为目标。对于angular2 jwt v5和RxJS v5,您应该使用angular2 jwt v1。

您使用的是angular2 jwt版本2吗?我安装了npm安装--save@auth0/Angular jwt和Angular的哪个版本?Angular的版本是5.0您使用了错误的版本,尝试与Angular v5和RxJS v5兼容。我安装了npm安装--save@auth0/Angular jwtuse npm安装--save angular2 jwt