2017-04-25 144 views
1

我只想背景地理位置添加到我的离子2应用程序运行:缺少的依赖关系,在未得到满足的离子对依赖2

npm install --save @ionic-native/background-geolocation 

我得到的错误:

> ├── @ionic-native/[email protected] ├── UNMET PEER 
> DEPENDENCY @ionic-native/[email protected]^3.1.0 └── UNMET PEER DEPENDENCY 
> [email protected] 
> 
> npm WARN @ionic-native/[email protected] requires a peer of 
> @ionic-native/[email protected]^3.1.0 but none was installed. npm WARN 
> @ionic-native/[email protected] requires a peer of 
> [email protected]^5.0.1 but none was installed. 

我的package.json外观像这样:

{ 
    "name": "ionic-hello-world", 
    "author": "Ionic Framework", 
    "homepage": "http://ionicframework.com/", 
    "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" 
    }, 
    "dependencies": { 
    "@angular/common": "2.2.1", 
    "@angular/compiler": "2.2.1", 
    "@angular/compiler-cli": "2.2.1", 
    "@angular/core": "2.2.1", 
    "@angular/forms": "2.2.1", 
    "@angular/http": "2.2.1", 
    "@angular/platform-browser": "2.2.1", 
    "@angular/platform-browser-dynamic": "2.2.1", 
    "@angular/platform-server": "2.2.1", 
    "@ionic-native/background-geolocation": "^3.5.0", 
    "@ionic-native/core": "^3.5.0", 
    "@ionic/cloud-angular": "^0.11.0", 
    "@ionic/storage": "1.1.7", 
    "ionic-angular": "2.0.1", 
    "ionic-native": "2.4.1", 
    "ionicons": "3.0.0", 
    "rxjs": "5.0.0-beta.12", 
    "sw-toolbox": "3.4.0", 
    "zone.js": "0.6.26" 
    }, 
    "devDependencies": { 
    "@ionic/app-scripts": "1.0.0", 
    "typescript": "2.0.9" 
    }, 
    "cordovaPlugins": [ 
    "cordova-plugin-whitelist", 
    "cordova-plugin-console", 
    "cordova-plugin-statusbar", 
    "cordova-plugin-device", 
    "cordova-plugin-splashscreen", 
    "ionic-plugin-keyboard" 
    ], 
    "cordovaPlatforms": [ 
    "ios", 
    { 
     "platform": "ios", 
     "version": "", 
     "locator": "ios" 
    } 
    ], 
    "description": "App2: An Ionic project" 
} 

我该如何解决这个问题?

回答

1

同行的依赖只是一个警告,它不会破坏你的身材,你需要对等的依赖是@ionic-native/[email protected]^3.1.0[email protected]^5.0.1

我看你有没有"rxjs": "5.0.0-beta.12"改变它"rxjs": "^5.0.1"

@ionic-native/core我看你有没有"@ionic-native/core": "^3.5.0"及其更高版本的对等依赖需要..可能会很好。