Javascript 类型脚本错误:模块'&引用/节点“U模块/rxjs/Rx”';没有导出的成员';订阅式';
基本上,我试图构建一个应用程序,向服务器发送http请求,并在应用程序上显示数据。我遵循了这一点。我完成了上面显示的步骤。但在安装所有模块后,我遇到了以下异常。我对爱奥尼亚知之甚少。所以给我一篇文章和描述性解决方案 packages.jsonJavascript 类型脚本错误:模块'&引用/节点“U模块/rxjs/Rx”';没有导出的成员';订阅式';,javascript,angular,typescript,rxjs,ionic3,Javascript,Angular,Typescript,Rxjs,Ionic3,基本上,我试图构建一个应用程序,向服务器发送http请求,并在应用程序上显示数据。我遵循了这一点。我完成了上面显示的步骤。但在安装所有模块后,我遇到了以下异常。我对爱奥尼亚知之甚少。所以给我一篇文章和描述性解决方案 packages.json { "name": "CompassApp", "version": "0.0.1", "author": "Ionic Framework", "homepage": "http://ionicframework.com/", "
{
"name": "CompassApp",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"@agm/core": "^1.0.0-beta.3",
"@angular/animations": "5.2.10",
"@angular/common": "^6.0.3",
"@angular/compiler": "^6.0.3",
"@angular/compiler-cli": "^6.0.3",
"@angular/core": "^6.0.3",
"@angular/forms": "^6.0.3",
"@angular/http": "^6.0.3",
"@angular/platform-browser": "^6.0.3",
"@angular/platform-browser-dynamic": "^6.0.3",
"@ionic-native/barcode-scanner": "^4.7.0",
"@ionic-native/core": "4.7.0",
"@ionic-native/http": "^4.7.0",
"@ionic-native/splash-screen": "4.7.0",
"@ionic-native/status-bar": "4.7.0",
"@ionic/pro": "1.0.20",
"@ionic/storage": "2.1.3",
"angularfire2": "^5.0.0-rc.10",
"cordova-plugin-advanced-http": "^1.11.1",
"firebase": "^5.0.4",
"ionic-angular": "3.9.2",
"ionicons": "3.0.0",
"phonegap-plugin-barcodescanner": "^8.0.0",
"rxjs": "^5.5.11",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.26"
},
"devDependencies": {
"@ionic/app-scripts": "3.1.9",
"typescript": "~2.6.2"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"phonegap-plugin-barcodescanner": {},
"cordova-plugin-advanced-http": {}
}
}
}
Rect.ts
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
/*
Generated class for the RestProvider provider.
See https://angular.io/guide/dependency-injection for more info on providers
and Angular DI.
*/
@Injectable()
export class RestProvider {
apiUrl = 'https://jsonplaceholder.typicode.com';
constructor(public http: HttpClient) {
console.log('Hello RestProvider Provider');
}
getUsers() {
return new Promise(resolve => {
this.http.get(this.apiUrl+'/users').subscribe(data => {
resolve(data);
}, err => {
console.log(err);
});
});
}
}
Angular 6不适用于RxJS 5.5,但适用于RxJS 6
您的package.json应该包含
“rxjs”:“^6.1.0”
如何安装该版本,如我所见5.5.11是最新版本,似乎尚未更新:请参阅。你可以npmirxjs@6
不工作我安装了最新版本的Returing Typescript错误模块“E:/AndroidProject/CompassApp/node_modules/rxjs/Observable”没有导出成员“Observable”使用以下行进行可观测导入:从“rxjs”导入{Observable}@sriharsha_bhat那些事实上并没有解决我的问题,这就是为什么我张贴它again@ivaro18预览帖子上没有解决方案。为什么要将其标记为重复