Angular 找不到模块';rxjs/内部/可观察';
我想在我的服务中使用JwtHelperService模块,但出现以下错误: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 *
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