我无法在Ionic 3中安装Cordova Plugin ImagePicker或SqlLite

时间:2017-11-21 22:39:10

标签: angular cordova npm

我使用Ionic版本3.x(3.13.1),我尝试使用带有Image Picker的相机原生插件来从设备中选择图像。

当我尝试使用以下命令安装Image Picker插件时:ionic cordova plugin add cordova-plugin-telerik-imagepicker --variable PHOTO_LIBRARY_USAGE_DESCRIPTION="your usage message"

当我尝试使用:ionic cordova plugin add cordova-sqlite-storage

安装SQLite时,会出现同样的情况

我收到以下错误:

"PHOTO_LIBRARY_... (exit code 1):

        Error: Failed to fetch plugin cordova-plugin-telerik-imagepicker via registry.
        Probably this is either a connection problem, or plugin spec is incorrect.
        Check your connection and plugin name/version/URL.
        Error: npm: Command failed with exit code 1 Error output:
        npm ERR! Linux 4.10.0-38-generic
        npm ERR! argv "/usr/bin/nodejs" "/home/my/project/node_modules/.bin/npm" "install" 
        "cordova-plugin-telerik-imagepicker" "--production" "--save"
        npm ERR! node v8.1.4
        npm ERR! npm  v2.15.12
        npm ERR! code EPEERINVALID

        npm ERR! peerinvalid The package @angular/common@4.1.3 does not satisfy its siblings' peerDependencies 
        requirements!
        npm ERR! peerinvalid Peer @angular/cdk@2.0.0-beta.12 wants @angular/common@~4.4.4
        npm ERR! peerinvalid Peer @angular/forms@4.1.3 wants @angular/common@4.1.3
        npm ERR! peerinvalid Peer @angular/material@2.0.0-beta.12 wants @angular/common@~4.4.4
        npm ERR! peerinvalid Peer @angular/platform-browser@4.1.3 wants @angular/common@4.1.3
        npm ERR! peerinvalid Peer @angular/platform-browser-dynamic@4.1.3 wants @angular/common@4.1.3
        npm ERR! peerinvalid Peer angularfire2@4.0.0-rc0 wants @angular/common@^4.0.0
        npm ERR! peerinvalid Peer ionic-angular@3.6.1 wants @angular/common@4.1.3
        npm ERR! peerinvalid Peer ng2-charts@1.6.0 wants @angular/common@^2.3.0 || >=4.0.0

这是我的package.json文件:

{
  "name": "App",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@angular/cdk": "^2.0.0-beta.12",
    "@angular/common": "^4.1.3",
    "@angular/compiler": "4.1.3",
    "@angular/compiler-cli": "4.1.3",
    "@angular/core": "4.1.3",
    "@angular/forms": "4.1.3",
    "@angular/http": "4.1.3",
    "@angular/material": "^2.0.0-beta.12",
    "@angular/platform-browser": "4.1.3",
    "@angular/platform-browser-dynamic": "4.1.3",
    "@ionic-native/camera": "^4.4.0",
    "@ionic-native/camera-preview": "^4.3.3",
    "@ionic-native/core": "^3.14.0",
    "@ionic-native/diagnostic": "^4.3.3",
    "@ionic-native/file": "^4.3.3",
    "@ionic-native/image-picker": "^4.4.0",
    "@ionic-native/intercom": "^4.3.3",
    "@ionic-native/splash-screen": "3.12.1",
    "@ionic-native/status-bar": "3.12.1",
    "@ionic/storage": "2.0.1",
    "angularfire2": "^4.0.0-rc0",
    "chart.js": "^2.7.1",
    "cordova-android": "^6.3.0",
    "cordova-browser": "^4.1.0",
    "cordova-ios": "^4.4.0",
    "cordova-plugin-camera": "^2.4.1",
    "cordova-plugin-camera-preview": "^0.9.0",
    "cordova-plugin-compat": "^1.2.0",
    "cordova-plugin-console": "^1.1.0",
    "cordova-plugin-device": "^1.1.6",
    "cordova-plugin-file": "^4.3.3",
    "cordova-plugin-intercom": "^4.0.0",
    "cordova-plugin-splashscreen": "^4.0.3",
    "cordova-plugin-statusbar": "^2.2.3",
    "cordova-plugin-whitelist": "^1.3.2",
    "cordova.plugins.diagnostic": "^3.7.1",
    "firebase": "^4.6.1",
    "intl": "1.2.5",
    "ion2-calendar": "^2.1.0",
    "ionic-angular": "3.6.1",
    "ionic-img-viewer": "^2.7.3",
    "ionic-plugin-keyboard": "^2.2.1",
    "ionic2-calendar": "^0.3.11",
    "ionic2-super-tabs": "^4.1.4",
    "ionicons": "3.0.0",
    "moment": "^2.19.1",
    "ng2-charts": "^1.6.0",
    "promise-polyfill": "^6.0.2",
    "rxjs": "^5.5.2",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.12"
  },
  "devDependencies": {
    "@ionic/app-scripts": "2.1.4",
    "ionic": "3.13.1",
    "typescript": "2.3.4"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-console": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-whitelist": {},
      "ionic-plugin-keyboard": {},
      "cordova-plugin-intercom": {},
      "cordova-plugin-camera": {},
      "cordova.plugins.diagnostic": {}
    },
    "dependencies": {
      "@angular/cdk": "^2.0.0-beta.10",
      "@angular/common": "4.1.3",
      "@angular/compiler": "4.1.3",
      "@angular/compiler-cli": "4.1.3",
      "@angular/core": "4.1.3",
      "@angular/forms": "4.1.3",
      "@angular/http": "4.1.3",
      "@angular/material": "^2.0.0-beta.10",
      "@angular/platform-browser": "4.1.3",
      "@angular/platform-browser-dynamic": "4.1.3",
      "@ionic-native/core": "3.12.1",
      "@ionic-native/intercom": "^4.3.2",
      "@ionic-native/splash-screen": "3.12.1",
      "@ionic-native/status-bar": "3.12.1",
      "@ionic/storage": "2.0.1",
      "angularfire2": "^4.0.0-rc.2",
      "cordova-android": "^6.3.0",
      "cordova-browser": "^4.1.0",
      "cordova-plugin-console": "^1.1.0",
      "cordova-plugin-device": "^1.1.6",
      "cordova-plugin-intercom": "^4.0.0",
      "cordova-plugin-splashscreen": "^4.0.3",
      "cordova-plugin-statusbar": "^2.2.3",
      "cordova-plugin-whitelist": "^1.3.2",
      "firebase": "^4.4.0",
      "intl": "1.2.5",
      "ion2-calendar": "^2.0.8",
      "ionic-angular": "3.6.1",
      "ionic-plugin-keyboard": "^2.2.1",
      "ionic2-calendar": "^0.3.10",
      "ionic2-super-tabs": "^4.1.0",
      "ionicons": "3.0.0",
      "moment": "^2.19.1",
      "promise-polyfill": "^6.0.2",
      "rxjs": "5.4.0",
      "sw-toolbox": "3.6.0",
      "zone.js": "0.8.12"
    },
    "devDependencies": {
      "@ionic/app-scripts": "2.1.4",
      "@ionic/cli-plugin-ionic-angular": "1.4.1",
      "ionic": "3.16.0",
      "typescript": "2.3.4"
    },
    "description": "An Ionic project",
    "cordova": {
      "plugins": {
        "cordova-plugin-console": {},
        "cordova-plugin-device": {},
        "cordova-plugin-splashscreen": {},
        "cordova-plugin-statusbar": {},
        "cordova-plugin-whitelist": {},
        "ionic-plugin-keyboard": {},
        "cordova-plugin-intercom": {}
      },
      "platforms": [
        "android",
        "browser"
      ]
    },
    "platforms": [
      "android",
      "browser"
    ]
  }
}

我尝试将@ angular / common更改为4.4.4版,但错误仍然出现。我究竟做错了什么?或者我该怎么办?

0 个答案:

没有答案