Error: Failed to fetch platform cordova-android@latest

Hi,

When I try to add my android platform back in to my project I get a weird error.

> cordova platform add android@latest --save
✖ Running command - failed!
[ERROR] Exception: Using cordova-fetch for cordova-android@latest

        Error: Failed to fetch platform cordova-android@latest
        Probably this is either a connection problem, or platform spec is 
        incorrect.
        Check your connection and platform name/version/URL.
        Error: npm: Command failed with exit code 1 Error output:
        npm ERR! Linux 4.10.0-37-generic
        npm ERR! argv "/usr/local/bin/node" 
        "/home/thijmen/Desktop/abk/node_modules/.bin/npm" "install" 
        "cordova-android@latest" "--production" "--save-exact"
        npm ERR! node v6.11.4
        npm ERR! npm  v2.15.12
        npm ERR! code EPEERINVALID
        
        npm ERR! peerinvalid The package zone.js@0.8.18 does not satisfy its 
        siblings' peerDependencies requirements!
        npm ERR! peerinvalid Peer @angular/core@2.4.10 wants zone.js@^0.7.2
        
        npm ERR! Please include the following file with any support request:
        npm ERR!     /home/thijmen/Desktop/abk/npm-debug.log

Ionic info

cli packages: (/home/thijmen/Desktop/abk/node_modules)

    @ionic/cli-utils  : 1.13.1
    ionic (Ionic CLI) : 3.13.2

global packages:

    cordova (Cordova CLI) : 7.1.0 

local packages:

    @ionic/app-scripts : 3.0.0
    Cordova Platforms  : none
    Ionic Framework    : ionic-angular 3.3.0

System:

    Node : v6.11.4
    npm  : 2.15.12 
    OS   : Linux 4.10

Misc:

    backend : pro

I hope some one knows a fix for this.

Thanks in advance

This says that your zone.js is too new for @angular/core. It also shows that your @angular/core is old.
Your Cordova CLI is quite new, so installing quite new cordova-android version that probably suggest this new zone.js version.

What does your package.json look like?

I need this version of Zone.js because other plugins need this version and can’t been runned with the older one.

{
  "name": "(Hidden because of customer)",
  "version": "1.0.0",
  "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/common": "4.1.2",
    "@angular/compiler": "4.1.2",
    "@angular/compiler-cli": "4.1.2",
    "@angular/core": "4.1.2",
    "@angular/forms": "4.1.2",
    "@angular/http": "4.1.2",
    "@angular/platform-browser": "4.1.2",
    "@angular/platform-browser-dynamic": "4.1.2",
    "@ionic-native/camera": "^3.12.1",
    "@ionic-native/core": "3.12.1",
    "@ionic-native/device": "^4.3.2",
    "@ionic-native/network": "^4.3.2",
    "@ionic-native/onesignal": "^4.3.2",
    "@ionic-native/push": "^4.3.2",
    "@ionic-native/splash-screen": "3.12.1",
    "@ionic-native/status-bar": "3.12.1",
    "@ionic/cloud-angular": "^0.12.0",
    "@ionic/storage": "2.0.1",
    "@types/pouchdb": "6.3.0",
    "angular2-signaturepad": "^2.5.0",
    "cordova": "^7.1.0",
    "cordova-browser": "^4.1.0",
    "cordova-ios": "^4.5.2",
    "cordova-plugin-add-swift-support": "^1.7.0",
    "cordova-plugin-app-version": "^0.1.9",
    "cordova-plugin-camera": "^2.4.1",
    "cordova-plugin-compat": "^1.1.0",
    "cordova-plugin-console": "^1.1.0",
    "cordova-plugin-device": "^1.1.6",
    "cordova-plugin-ionic": "^1.1.9",
    "cordova-plugin-ionic-webview": "^1.1.15",
    "cordova-plugin-network-information": "^1.3.3",
    "cordova-plugin-splashscreen": "^4.0.3",
    "cordova-plugin-statusbar": "^2.2.3",
    "cordova-plugin-tts": "^0.2.3",
    "cordova-plugin-whitelist": "^1.3.2",
    "font-awesome": "4.7.0",
    "gulp": "^3.9.1",
    "ionic": "^3.13.0",
    "ionic-angular": "3.3.0",
    "ionic-plugin-keyboard": "^2.2.1",
    "ionicons": "3.0.0",
    "jquery": "^3.2.1",
    "jsdom": "^11.3.0",
    "konva": "^1.7.2",
    "phonegap-plugin-push": "^2.0.0",
    "pouchdb": "^6.3.4",
    "pouchdb-browser": "^6.3.4",
    "rxjs": "5.4.0",
    "sudo": "^1.0.3",
    "superagent": "^3.6.3",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.12"
  },
  "devDependencies": {
    "@ionic/app-scripts": "^3.0.0",
    "ionic": "^3.13.1",
    "typescript": "2.3.3"
  },
  "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-network-information": {},
      "cordova-plugin-ionic": {
        "APP_ID": "5de5adaa",
        "CHANNEL_NAME": "Master",
        "UPDATE_METHOD": "background",
        "UPDATE_API": "https://api.ionicjs.com",
        "MAX_STORE": "2"
      },
      "cordova-plugin-ionic-webview": {}
    },
    "platforms": [
      "browser",
      "android",
      "ios"
    ]
  }
}

Then it seems you have to decide: New cordova-android or old “other plugins”.

ionic cordova platform rm android
ionic cordova platform add android