未满足的同伴依赖@ionic-native/native-audio

UNMET PEER DEPENDENCY @ionic-native/native-audio

我正在尝试安装 Native Audio 但我收到此错误:

UNMET PEER DEPENDENCY @ionic-native/core@3.4.2
@ionic-native/native-audio@3.6.1

我已经删除了 'node_modules' 文件夹并 npm 安装依赖项,但我仍然收到此错误。

"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.4.2",
    "@ionic-native/native-audio": "^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.0",
    "ionicons": "3.0.0",
    "rxjs": "5.1.1",
    "sw-toolbox": "3.4.0",
    "zone.js": "^0.8.5"
  },
  "devDependencies": {
    "@ionic/app-scripts": "1.3.6",
    "typescript": "~2.2.1"
  },

我该如何解决这个问题?

我复制了你的依赖项,警告是关于@ionic-native/core

的指定版本

您的 project.json 指定 3.4.2 但需要 3.6.0

如果您将 project.json 依赖项更新为以下警告应该消失(不要忘记 运行 npm cache cleannpm install 之前)

"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.0",
"@ionic-native/native-audio": "^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.0",
"ionicons": "3.0.0",
"rxjs": "5.1.1",
"sw-toolbox": "3.4.0",
"zone.js": "^0.8.5"
}