How to fix Failed to fetch platform cordova-ios@~4.4.0

I have resolved this, it appears to be an NPM issue and not a Cordova one. I just updated NPM within Terminal and after the update "cordova platform add ios" worked fine. Happy days - 1 !

npm update -g

  1. Delete the folder cordova-ios, located in node_modules/cordova-ios.

  2. Type the following command

    ionic cordova build ios
    

Sometimes a previously added Platform is not removed Properly, so this type of issue occurs. Remove the platform by command and add it again..

Follow this steps:

  1. Run the command

     ionic cordova platform remove ios
    
  2. Run the command:

     ionic cordova platform add ios --save
    
  3. If you are still getting the issue, try running again:

     ionic cordova platform remove ios --save
    

NOTE: By running again the command ionic cordova platform remove ios --save fetches newer version of ios platform.
For example:

  • First time: cordova-fetch for cordova-ios@~4.5.1
  • Second time: cordova-fetch for cordova-ios@~4.5.4

Tags:

Ios

Cordova

Npm