我只想将背景地理位置添加到我的离子2应用程序中:
npm install --save @ionic-native/background-geolocation
我得到错误:
> ├── @ionic-native/background-geolocation@3.5.0 ├── UNMET PEER
> DEPENDENCY @ionic-native/core@^3.1.0 └── UNMET PEER DEPENDENCY
> rxjs@5.0.0-beta.12
>
> npm WARN @ionic-native/background-geolocation@3.5.0 requires a peer of
> @ionic-native/core@^3.1.0 but none was installed. npm WARN
> @ionic-native/background-geolocation@3.5.0 requires a peer of
> rxjs@^5.0.1 but none was installed.
我的软件包。
{
"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"
}
我该如何修复?
同伴依赖性只是警告,它不会破坏您的构建,您需要的同伴依赖项是@ionic-native/core@^3.1.0
和rxjs@^5.0.1
我看到您有"rxjs": "5.0.0-beta.12"
将其更改为"rxjs": "^5.0.1"
至于@ionic-native/core
,我看到您有"@ionic-native/core": "^3.5.0"
,并且是同行依赖性需求的后期版本。