打字稿错误在@ ionic-native / geolocation中找不到名称'Observable'

问题描述 投票:3回答:3

我正在使用Ionic 2并试图使用@ ionic-native / geolocation,当我做离子时:我的项目上的serv我得到了这个错误:找不到名字'Observable'。

去AZ小说网POI她CK.i蒙古人.com/DX ND炒.PNG

这是我的package.json文件内容:

[1]: https://i.s

先感谢您。

angular ionic2 ionic3
3个回答
0
投票

尝试删除你的{ "author": "", "cordovaPlatforms": [], "cordovaPlugins": [ "cordova-plugin-whitelist", "cordova-plugin-console", "cordova-plugin-statusbar", "cordova-plugin-device", "cordova-plugin-splashscreen", "ionic-plugin-keyboard", "cordova-plugin-geolocation" ], "dependencies": { "@angular/common": "4.0.2", "@angular/compiler": "4.0.2", "@angular/compiler-cli": "4.0.2", "@angular/core": "4.0.2", "@angular/forms": "4.0.2", "@angular/http": "4.0.2", "@angular/platform-browser": "4.0.2", "@angular/platform-browser-dynamic": "4.0.2", "@ionic-native/core": "3.6.1", "@ionic-native/splash-screen": "3.4.2", "@ionic-native/status-bar": "3.4.2", "@ionic/storage": "2.0.1", "ionic-angular": "^3.1.1", "ionicons": "3.0.0", "rxjs": "^5.3.1", "sw-toolbox": "3.4.0", "zone.js": "^0.8.5" }, "devDependencies": { "@ionic/app-scripts": "1.3.4", "typescript": "~2.2.1" }, "homepage": "", "name": "Wakeb", "version": "0.0.0", "private": true, "scripts": { "clean": "ionic-app-scripts clean", "build": "ionic-app-scripts build", "ionic:build": "ionic-app-scripts build", "ionic:serve": "ionic-app-scripts serve", "watch": "ionic-app-scripts watch" }, "-vs-binding": { "ProjectOpened": [ "ionic:build", "ionic:serve" ] } } 文件夹并运行一个新的node_modules。您可能还想尝试运行npm install并重新添加ionic plugin remove cordova-plugin-geolocation


0
投票

我没有添加@ ionic-native / geolocation,它在添加后现在正在工作,谢谢。


0
投票

你的package.json缺少ionic plugin add cordova-plugin-geolocation

做:

@ionic-native/geolocation

安装它。

© www.soinside.com 2019 - 2024. All rights reserved.