12

我在尝试着:

cordova platform add ios

但是我总是收到以下错误:

Failed to install 'cordova-plugin-whitelist':CordovaError: Plugin doesn't support this project's cordova-ios version. cordova-ios: 3.8.0, failed version requirement: >=4.0.0-dev
    at checkEngines (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:116:29)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:289:16
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:557:44
    at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:355:11)
Plugin doesn't support this project's cordova-ios version. cordova-ios: 3.8.0, failed version requirement: >=4.0.0-dev

这是我的package.json

    {
  "name": "App",
  "version": "1.0.0",
  "description": "App",
  "dependencies": {
    "gulp": "^3.5.6",
    "gulp-coffee": "^2.1.1",
    "gulp-sass": "2.0.0",
    "gulp-slim": "",
    "gulp-concat": "^2.2.0",
    "gulp-minify-css": "^0.3.0",
    "gulp-rename": "^1.2.0",
    "gulp-watch": "^0.6.8"
  },
  "devDependencies": {
    "bower": "^1.3.3",
    "fs": "0.0.2",
    "gulp-changed": "^1.1.1",
    "gulp-clean": "^0.3.1",
    "gulp-replace-task": "^0.1.0",
    "gulp-util": "~3.0.0",
    "shelljs": "^0.3.0",
    "yargs": "^1.3.3"
  },
  "cordovaPlugins": [
    "https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git",
    "https://git-wip-us.apache.org/repos/asf/cordova-plugin-console.git",
    "https://github.com/Pushwoosh/pushwoosh-phonegap-3.0-plugin.git",
    "https://github.com/apache/cordova-plugin-globalization.git",
    "org.apache.cordova.inappbrowser",
    "org.apache.cordova.console",
    "org.apache.cordova.device",
    "org.apache.cordova.statusbar",
    "org.apache.cordova.splashscreen",
    "org.apache.cordova.geolocation",
    "org.apache.cordova.camera",
    "org.apache.cordova.file-transfer",
    "com.ionic.keyboard",
    "./engine/cordova-crosswalk-engine-c0.6.2",
    {
      "locator": "engine/cordova-crosswalk-engine-c0.7.1",
      "id": "cordova-plugin-crosswalk-webview"
    },
    "https://github.com/apache/cordova-plugin-whitelist.git"
  ],
  "cordovaPlatforms": [
    {
      "platform": "android",
      "locator": "./engine/cordova-android-c0.6.1/"
    }
  ]
}

有什么想法我可能做错了吗?

4

2 回答 2

6

试试这个,首先升级你所有的 npm 包(这可能需要一段时间)

npm update -g

然后尝试安装平台

cordova platform add ios

如果您仍然遇到问题,请先尝试删除平台(也许您已经安装了它)

cordova platform rm ios

然后再次添加

cordova platform add ios

你也可以试试这个:

cordova platform update ios

(从这里https://cordova.apache.org/docs/en/5.0.0/guide_platforms_ios_upgrade.md.html#Upgrading%20iOS

希望这可以帮助

于 2015-06-07T22:55:13.593 回答
1

只需使用兼容IOS平台3.8.0的白名单插件版本,直到4.0.0正式发布。

<plugin name="cordova-plugin-whitelist" spec="1.0.0" />
于 2015-09-25T13:29:01.410 回答