Typescript Error Cannot find the name "Observable" in @ ionic-native / geolocation

I am using Ionic 2 and trying to use @ ionic-native / geolocation when I do ionic: serv on my project I got this error: Can't find the name "Observable".

[1]: https: // istack.imgur. com /dXNDc.png

These are the contents of my package. json:

{
  "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"
    ]
  }
}

      

Thanks in advance.

+3


source to share


3 answers


Try deleting the folder node_modules

and starting a new one npm install

. You can also try starting ionic plugin remove cordova-plugin-geolocation

and re-adding withionic plugin add cordova-plugin-geolocation



0


source


I didn't add @ ionic-native / geolocation, now it works after adding, thanks.



0


source


Your package .json is missing @ionic-native/geolocation

.

do:

 npm install --save @ionic-native/geolocation

      

to install it.

0


source







All Articles